What install files in location - Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5

霸气de小男生 提交于 2019-11-30 08:10:14

问题


Please bear with me on this, I will try to explain as clearly as I can.

I started a new project (class library) which targets 4.5 and not the client profile 4.5.

I added a reference "System.Runtime.Serialization" and the properties indicates it's in location "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Runtime.Serialization.dll"

On my pc it compiles fine with a build script using msbuild.

On the buildserver which uses team city - it complains

error CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

The buildserver has the full .net framework installed - "dotnetfx45_full_x86_x64.exe"

The only time it will build is if I copy my version of "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5" to the target machine.

I have checked using this link and .net 4.5 is installed - http://myspworld.wordpress.com/2012/10/18/how-to-check-if-net-4-5-is-installed-on-a-server/

I am asking two question: 1. How does this get installed? 2. If it does find it in this location surely it should look in the GAC?

Will appreciate any help on this.


回答1:


It's the Windows SDK:

The Windows SDK includes the reference assemblies, tools, headers, and libraries needed to build applications that target the .NET Framework 4.5.

(For 1.1 and 2.0, there was a separate .NET Framework SDK, but I can't find a link for any more recent versions - I don't think it's separately available)


For part 2, no. The GAC is not searched at compile time. It's only used at runtime.



来源:https://stackoverflow.com/questions/14517873/what-install-files-in-location-program-files-x86-reference-assemblies-micros

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!