TFS 2010中创建的.Net 4.0 XmlSerializers DLL对于.NET 3.5的应用Net、TFS、NET、XmlSerializers

由网友(念着旧伤)分享简介:我们必须运行在Visual Studio 2010中的目标。NET 3.5的一个ASP.Net Web应用程序。它是由TFS 2010年建立了这个Web应用程序有几个网页引用,因此该版本会创建一个相关XmlSerializers DLL。这个DLL,但是,是一个.NET 4.0组件。 We have a ASP.Ne...

我们必须运行在Visual Studio 2010中的目标。NET 3.5的一个ASP.Net Web应用程序。它是由TFS 2010年建立了这个Web应用程序有几个网页引用,因此该版本会创建一个相关XmlSerializers DLL。这个DLL,但是,是一个.NET 4.0组件。

We have a ASP.Net web application running in Visual Studio 2010 that is targeting .Net 3.5. It's being built by TFS 2010. This web application has a couple web references, so the build creates a related XmlSerializers DLL. This DLL, however, is a .Net 4.0 assembly.

当我运行从生成此Web应用程序,我得到的错误:

When I run this web application from the build, I get the error:

无法加载文件或程序集   BLAH_BLAH_WEB_APPLICATION_NAME.XmlSerializers   它的依赖或之一。本   组件由一个运行时更新的建   比当前加载的运行时和   不能被加载

Could not load file or assembly 'BLAH_BLAH_WEB_APPLICATION_NAME.XmlSerializers' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

我们使用的是2008年被TFS下一个工作的MSBuild .proj文件(使用在生成定义升级模板)。只见这个问题和这一个,但那些提及使用特定SGEN生成步骤。我们不是。此外,提出的解决方案包括硬编码路径7.0A SGEN,这只是......难看。

We are using a msbuild .proj file that was working under TFS 2008 (using the "Upgrade Template" in the Build Definition). I saw this question and this one, but those mention using a specific SGen build step. We are not. Additionally, the proposed solution involve hard-coding the path to the 7.0A SGen, which is just...ugly.

有没有办法强制TFS 2010版本编译此XmlSerializers DLL作为.NET 3.5大会?

Is there a way to force the TFS 2010 build to compile this XmlSerializers DLL as a .Net 3.5 Assembly?

推荐答案

问题的根源是,在注册表中的值无效。在HKEY_LOCAL_MACHINE SOFTWARE的SDK35ToolsPath值微软的MSBuild ToolsVersions 4.0是:

The root problem was an invalid value in the registry. The SDK35ToolsPath value under HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSBuildToolsVersions4.0 was:

$(注册表:HKEY_LOCAL_MACHINE SOFTWARE 微软微软   的SDK 的Windows v7.0A WinSDK-NetFx35Tools 86 @ InstallationFolder)

$(Registry:HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SDKsWindowsv7.0AWinSDK-NetFx35Tools-x86@InstallationFolder)

但是,构建服务器有Windows SDK的7.1版本。所以,我修正值是:

However, the build server had Windows SDK version 7.1. So, I corrected the value to be:

$(注册表:HKEY_LOCAL_MACHINE SOFTWARE 微软微软   的SDK 的Windows V7.1 WinSDKNetFx35Tools @ InstallationFolder)

除了SVN,还可以使用的文档管理工具 TFS 使用VS2010连接TFS的使用说明和简单操作手册

$(Registry:HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SDKsWindowsv7.1WinSDKNetFx35Tools@InstallationFolder)

然后XmlSerializers DLL是现在使用的.Net 2.0。

Then XmlSerializers DLL was now using .Net 2.0.

阅读全文

相关推荐

最新文章