What is the different between Reference Assemblies

2019-04-05 21:57发布

I have been investigating some issues with Web Performance Test Plugins in Visual Studio 2013. When adding references to the necessary dlls (e.g. Microsoft.VisualStudio.QualityTools.WebTestFramework.dll) I noticed that there are multiple entries for the same dll available in the 'Add References' window. On my system I have five choices for WebTestFramework.

Some of these I see are from earlier versions of Visual Studio which are also installed on my machine. However, I see that some are duplicates, e.g.:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\WebTestFramework.dll

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\WebTestFramework.dll

I've compared the hashes of these two files and they are identical. So, why are they present in my VS 2013 (v12.0) installation twice? Why is there both a 'ReferenceAssemblies' and a 'PublicAssemblies' folder?

1条回答
Ridiculous、
2楼-- · 2019-04-05 22:44

Well, ideally the implementation assembly doesn't appear in the list. But the control over what appears in the list isn't fine-grained enough, it can only be configured by directory, not individual assemblies. A further constraint is that Microsoft is often forced to pick less than desirable storage locations for an assembly to maintain backwards compatibility with previous VS versions so they don't break existing projects. And the test frameworks have changed a great deal through the VS versions, took them a while to get all the quirks ironed out.

Always pick the reference assembly when one is offered. They are meant to isolate you from these rapid changes and often intentionally are not a copy of the implementation assembly. You'll get it to work when you pick the implementation assembly but you risk having your test project broken in the next VS version. YMMV.

查看更多
登录 后发表回答