的MSBuild找不到SGEN编译一个解决方案时, [英] MSBuild cannot find SGen when compiling a solution

查看:1264
本文介绍了的MSBuild找不到SGEN编译一个解决方案时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里看了其他几个SGEN相关的问题上,要么他们的答案不适用或他们的答案不解决这个问题对我来说。我已经安装了一些软件开发工具包,以没有运气解决这个问题。引用类型不应该被改变,因为这是这是一个问题的唯一地方。一旦建议是把SGen.exe到 C:\ WINDOWS \ Microsoft.NET \框架\器v3.5 文件夹,但是这没有完成的对话框,这是没有问题的。在这种情况下, SGen.exe 确实存在,并且是正确的它应该是,但MSBuild的仍是具有发现它由于某种原因,问题!

I've looked at several other SGen-related questions on here and either their answers don't apply or their answers don't fix this for me. I have installed several SDKs to fix this issue with no luck. Reference types should not be changed since this is the only place this is a problem. Once suggestion is to put SGen.exe into the C:\Windows\Microsoft.NET\Framework\v3.5 folder, but that's not been done on the box where this is not a problem. In this scenario, SGen.exe actually exists and is right where it's supposed to be, but MSBuild still is having issues with finding it for some reason!

背景:

我们有一个楠脚本,自动生成我们。在这种情况下,恶性呼吁的MSBuild和的MSBuild生成错误自称是找不到SGEN。该项目是.NET 3.5为基础的。我有我的主要开发环境(64位Vista旗舰版),其中的脚本完美的作品,我试图复制它在虚拟机(64位的Win 7旗舰版)。我想我拥有了一切的地步,我应该是好到去,但这个失败对Win7的盒子(完美的作品在Vista中框)。

We have a NAnt script that automates our builds. In this scenario, NAnt is calling MSBuild and MSBuild is generating the error claiming to be unable to find SGen. The project is .NET 3.5-based. I have my primary dev environment (64-bit Vista Ultimate) where the script works perfectly and I am attempting to duplicate it in a VM (64-bit Win 7 Ultimate). I THINK I have everything to the point where I should be good-to-go but this fails on the Win7 box (works perfectly on the Vista box).

我已经做了一些比较,这两个框之间,他们俩的的相同的在这方面,但它仍然失败。例如, HKEY_LOCAL_MACHINE \ SOFTWARE \微软\ .NETFramework sdkInstallRootv2.0 值设置为 C:\ Program Files文件\ Microsoft.NET \ SDK \ v2.0的64位\ 在两台机器上。在这两种机器, SGen.exe 是这条道路的子目录。

I have done some comparisons between the two boxes and they both look identical in this regard, but it still fails. For example, the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework's sdkInstallRootv2.0 value is set to C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\ on both machines. In both machines, SGen.exe is in that path's bin subdirectory.

楠脚本:

<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>

我得到的错误信息是这样的:

The error message I get is this:

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?

What am I doing wrong here that is causing MSBuild to STILL be unable to find SGen?

推荐答案

我不知道什么,或者为什么这发生,但我做了什么来解决这个问题是安装Visual Studio 2005。我已经安装了.NET 2.0 SDK,以及对.NET 3.5 SDK,没有运气,但与Visual Studio 2005的安装程序为我解决了这个问题的东西。这是一个可怕的解决方案,但它是,然而,一个解决方案。

I'm not sure what or why this was happening but what I did to get around this was to install Visual Studio 2005. I had already installed the .NET 2.0 SDK as well as the .NET 3.5 SDK with no luck but something with the Visual Studio 2005 installer resolved this issue for me. This is a HORRIBLE solution, but it was, nonetheless, a solution.

希望我们能迁移到.NET 4.0和即将完成摆脱.NET 2.0和它的问题。

Hopefully we can migrate to .NET 4.0 soon and be completed rid of .NET 2.0 and its issues.

这篇关于的MSBuild找不到SGEN编译一个解决方案时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆