How do I create and use a .NET metadata-only 'Reference Assembly'?

后端 未结 4 955
栀梦
栀梦 2020-12-08 07:57

Since version 3.0, .NET installs a bunch of different \'reference assemblies\' under C:\\Program Files\\Reference Assemblies\\Microsoft...., to support different profiles (s

4条回答
  •  渐次进展
    2020-12-08 08:09

    Yes, this is new for .NET 4.0. I'm fairly sure this was done to avoid the nasty versioning problems in the .NET 2.0 service packs. Best example is the WaitHandle.WaitOne(int) overload, added and documented in SP2. A popular overload because it avoids having to guess at the proper value for *exitContext" in the WaitOne(int, bool) overload. Problem is, the program bombs when it is run on a version of 2.0 that's older than SP2. Not a happy diagnostic either. Isolating the reference assemblies ensures that this can't happen again.

    I think those reference assemblies were created by starting from a copy of the compiled assemblies (like it was done in previous versions) and running them through a tool that strips the IL from the assembly. That tool is however not available to us, nothing in the bin/netfx 4.0 tools Windows 7.1 SDK subdirectory that could do this. Not exactly a tool that gets used often so it is probably not production quality :)

提交回复
热议问题