我有一个构建VS2008 / .NET 3.5项目的TFS构建服务
生成的dll在Reflecor中看起来很好,引用System.Drawing V2.0.50727
不幸的是,我无法在测试.NET 3.5机器上加载这些dll,因为“后策略引用”似乎强制执行.NET 4版本的system.drawings。
我想这是由使用.NET 4版本的MSBuild的TFS 2010引起的,但到目前为止我找不到任何方法来解决这个问题...
顺便说一下,在我的工作站上使用VS2008构建的解决方案工作得很好。
这是负载故障日志。无法通过Reflector在代码中或二进制文件中找到任何4.0引用。
=== Pre-bind state information ===
LOG: User = foo\bar
LOG: DisplayName = System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/foobar/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\foobar\baz.dll.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:\foobar\System.Drawing.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
简而言之,我最终构建了针对.NET 3.5框架的.NET 3.5解决方案,这有点道理。
所以我不知道问题是什么,但无论如何我摆脱了它。
注意:使用TFS 2010构建3.5框架是非常痛苦的:您必须提取msbuild命令行,跳过其TFS日志参数,并在构建模板xaml文件中放入InvokeProcess框。