一台机器上的建筑之间的区别VS2010安装的机器上安装了7.1 SDK [英] Differences between building on a machine with VS2010 installed and on a machine with the 7.1 SDK installed

查看:197
本文介绍了一台机器上的建筑之间的区别VS2010安装的机器上安装了7.1 SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在努力提升我们的code基使用Visual Studio 2010,但都具有让一切来分类在我们构建服务器的问题。我们不希望在我们构建服务器安装Visual Studio 2010等已安装只是.NET 4.0框架和SDK(V7.1)。

We are trying to upgrade our code base to use Visual Studio 2010 but are having problems getting everything sorted on our build servers. We do not want to install Visual Studio 2010 on our build servers and so have installed just the .Net 4 framework and SDK (v7.1).

我们仍然希望针对.NET 3.5平台(我们将升级到.NET 4在未来的某个时候,但不希望只是还没有)。

We are still wanting to target the .Net 3.5 platform (we will upgrade to .Net 4 at some point in the future but do not want to just yet).

我们已经成功地获得了code编译但现在我们遇到了类似以下运行时错误。

We have managed to get the code to compile but now we are running into runtime errors like the following.

无法加载文件或程序集System.Drawing中,版本= 4.0.0.0,文化=中性公钥= b03f5f7f11d50a3a或它的某一个依赖。该系统找不到指定的文件。

问题是,运行时尝试反序列化嵌入的资源,如果我看一下反射的资源,我看他们是所有的.NET 4.0的对象。例如,我们的一个Windows应用程序的图标类型的 System.Drawing.Icon,System.Drawing中,版本= 4.0.0.0,文化=中性公钥= b03f5f7f11d50a3a

The problem is that runtime is trying to deserialize the embedded resource and if I look at the resources in reflector, I see that they are all .Net 4.0 objects. For example, the icon of our a windows app is of type System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

因此​​,它看起来像的MSBuild被错误地编译资源(使用不同的运行时的目标)?我通过查看DLL的建立在我开发计算机的diff文件已经证实了这一点,并且建立在构建服务器上 - 可以清楚地看到,一个DLL的资源使用2.0.0.0版本,而其他(从构建服务器)使用4.0 .0.0。该项目引用是在两种情况下V2.0.0.0的DLL(正如人们所期望的那样)。

So it looks like MSBuild is compiling the resources incorrectly (using a different runtime to the target)? I have confirmed this by looking at the diffs of the dll built on my dev machine and that built on the build server - it is clear to see that one dll's resources use 2.0.0.0 version and the other (from the build server) uses 4.0.0.0. The project references are to the v2.0.0.0 dlls in both cases (as one would expect).

没有人有任何想法,为什么的MSBuild正在编制的资源为4.0的对象?

Does anyone have any idea as to why MSBuild is compiling the resources as 4.0 objects?

在此先感谢。

克里斯

推荐答案

在升级您的解决方案VS2010,你有没有改变目标的框架?你可以看看它通过查看文本编辑器中的csproj文件。 你有7.0A框架的构建服务器?

When you upgraded your solution to VS2010, did you change the targeted framework? You can look for it by viewing the csproj files in a text editor. Do you have the 7.0a framework in your build server?

编辑:

我前段时间碰到了同样的问题,它是与注册表项未设置。看看这里: <一href="http://connect.microsoft.com/VisualStudio/feedback/details/594338/tfs-2010-build-agent-and-windows-7-1-sdk-targeting-net-3-5-generates-wrong-embedded-resources" rel="nofollow">http://connect.microsoft.com/VisualStudio/feedback/details/594338/tfs-2010-build-agent-and-windows-7-1-sdk-targeting-net-3-5-generates-wrong-embedded-resources

I ran into the same problem a while ago and it has something to do with registry key not set. Take a look here : http://connect.microsoft.com/VisualStudio/feedback/details/594338/tfs-2010-build-agent-and-windows-7-1-sdk-targeting-net-3-5-generates-wrong-embedded-resources

我想你需要手动添加注册表项 HKLM \软件\微软\的MSBuild \ ToolsVersions \ SDK35ToolsPath

I think you need to manually add the registry key HKLM\Software\Microsoft\MsBuild\ToolsVersions\SDK35ToolsPath

这篇关于一台机器上的建筑之间的区别VS2010安装的机器上安装了7.1 SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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