Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the different between Reference Assemblies and Public Assemblies in Visual Studio

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?

like image 659
Holf Avatar asked Apr 08 '14 10:04

Holf


People also ask

What are reference assemblies?

Reference assemblies are usually distributed with the Software Development Kit (SDK) of a particular platform or library. Using a reference assembly enables developers to build programs that target a specific library version without having the full implementation assembly for that version.

What is assembly reference in asp net?

An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. Assemblies take the form of executable (.exe) or dynamic link library (. dll) files, and are the building blocks of . NET applications.


1 Answers

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.

like image 94
Hans Passant Avatar answered Sep 24 '22 21:09

Hans Passant