다른 SGen 관련 질문을 여기에서 살펴 보았습니다. 대답이 적용되지 않거나 답변으로 해결할 수 없습니다. 행운이 문제를 해결하기 위해 몇 가지 SDK를 설치했습니다. 참조 유형은 이것이 유일한 문제이기 때문에 변경하면 안됩니다. 한 번 제안은 C:\Windows\Microsoft.NET\Framework\v3.5
폴더에 SGen.exe를 넣는 것이지만 문제가되지 않는 상자에서는 완료되지 않았습니다. 이 시나리오에서는 SGen.exe
이 실제로 존재하며 올바른 위치에 있지만 MSBuild는 여전히 웬일인지 찾아야하는 문제가 있습니다!솔루션을 컴파일 할 때 MSBuild에서 SGen을 찾을 수 없습니다.
배경 :
우리는 우리의 빌드 자동화은 NAnt 스크립트가 있습니다. 이 시나리오에서 NAnt는 MSBuild를 호출하고 MSBuild는 SGen을 찾을 수 없다는 오류를 생성합니다. 이 프로젝트는 .NET 3.5 기반입니다. 나는 스크립트가 완벽하게 작동하고 VM (64 비트 Win 7 Ultimate)에서 복제하려고 시도하는 주 개발 환경 (64 비트 Vista Ultimate)이 있습니다. 나는 내가 잘해야 할 시점까지 모든 것을 가지고 있다고 생각하지만 이것은 Win7 박스에서 실패한다. (Vista 박스에서 완벽하게 작동한다.)
두 상자 사이의 비교를 수행했으며 모두 이 점에 관해서는 같아 보이지만 여전히 실패합니다. 예를 들어 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
의 sdkInstallRootv2.0
값은 두 시스템 모두에서 C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\
으로 설정됩니다. 두 시스템에서 SGen.exe
은 해당 경로의 bin
하위 디렉토리에 있습니다.
은 NAnt 스크립트 : 내가 잘못 여기에 원인이되는 그 무엇을하고 있는가
report-installer:
[exec] Microsoft (R) Build Engine Version 3.5.30729.4926
[exec] [Microsoft .NET Framework, Version 2.0.50727.4927]
[exec] Copyright (C) Microsoft Corporation 2007. All rights reserved.
[exec]
[exec] Build started 4/8/2010 11:28:23 AM.
[exec] Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" on node 0 (default targets).
[exec] Building solution configuration "Release|Any CPU".
[exec] Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" (1) is building "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.csproj" (2) on node 0 (default targets).
[exec] Could not locate the .NET Framework SDK. The task is looking for the path to the .NET Framework SDK at the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK. 2.) Manually set the above registry key to the correct location.
[exec] CoreCompile:
[exec] Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
[exec] C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1902,9): error MSB3091: Task failed because "sgen.exe" was not found, or the .NET Framework SDK v2.0 is not installed. The task is looking for "sgen.exe" in the "bin" subdirectory beneath the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK v2.0. 2.) Manually set the above registry key to the correct location. 3.) Pass the correct location into the "ToolPath" parameter of the task.
[exec] Done Building Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.csproj" (default targets) -- FAILED.
[exec] Done Building Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" (default targets) -- FAILED.
[exec]
[exec] Build FAILED.
[exec]
[exec] "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" (default target) (1) ->
[exec] "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.csproj" (default target) (2) ->
[exec] (GenerateSerializationAssemblies target) ->
[exec] C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1902,9): error MSB3091: Task failed because "sgen.exe" was not found, or the .NET Framework SDK v2.0 is not installed. The task is looking for "sgen.exe" in the "bin" subdirectory beneath the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK v2.0. 2.) Manually set the above registry key to the correct location. 3.) Pass the correct location into the "ToolPath" parameter of the task.
[exec]
[exec] 0 Warning(s)
[exec] 1 Error(s)
[exec]
[exec] Time Elapsed 00:00:00.24
[call] C:\Projects\Production\Source\reports.build(15,4):
[call] External Program Failed: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe (return code was 1)
MSBuild를 정지 SGen을 찾을 수 없습니다로 : 내가 얻을
<target name="report-installer" depends="fail-if-environment-not-set">
<exec program="MSBuild.exe" basedir="${framework35.directory}">
<arg value="${tools.directory.current}\ReportInstaller\ReportInstaller.sln" />
<arg value="/p:Configuration=${buildconfiguration.current}" />
</exec>
</target>
오류 메시지가이 무엇입니까?
설명을 위해 3.5 및 2.0 SDK를 설치했으며 이것에 대한 동작을 변경하지 않았습니다. – Jaxidian
NAnt에서 호출하지 않고 솔루션을 직접 MSBuild하려고 했습니까? – Filburt
그래, 같은 문제. – Jaxidian