Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ol> <li><p>Find some place to store the assemblies. For example, I store the .Net core assemblies like so:</p> <ul> <li><code>&lt;branch</code>>\NetFX\2.0527<code>\</code>*</li> <li><code>&lt;branch</code>>\NetFX\3.0<code>\</code>*</li> <li><code>&lt;branch</code>>\NetFX\3.5<code>\</code>*</li> <li><code>&lt;branch</code>>\NetFX\Silverlight 2<code>\</code>*</li> <li><code>&lt;branch</code>>\NetFX\Silverlight 3<code>\</code>*</li> </ul></li> <li><p>Use the ReferencePath property in MSBuild (or AdditionalReferencePath in Team Build) to point your projects at the appropriate paths. For simplicity and easy maintenance, I have 1 *.targets file that knows about every such directory; all of my projects Import that file. </p></li> <li>Make sure your version control strategy (branching, merging, local&lt;->server mappings) keeps the relative paths between your projects &amp; your reference paths constant.</li> </ol> <p>EDIT</p> <p>In response to the update in the question, let me add one more step:</p> <p>4) Make sure every assembly reference in every project file uses the full .Net strong name <em>and nothing else</em>.</p> <p>Bad:</p> <pre><code>&lt;Reference Include="Microsoft.SqlServer.Smo"&gt; &lt;SpecificVersion`&gt;False&lt;/SpecificVersion&gt; &lt;HintPath&gt;..\..\..\..\..\..\..\Program Files (x86)\Microsoft SQL Server\100\Shared\Microsoft.SqlServer.Smo.dll&lt;/HintPath&gt; &lt;/Reference&gt; </code></pre> <p>Good:</p> <pre><code>&lt;Reference Include="Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /&gt; </code></pre> <p>Advantages of the latter format:</p> <ul> <li>Using a HintPath in a collaborative development environment will inevitably lead to situations where "it works for me" but not others. Especially your build server. Omitting it forces you to get your reference paths correct or it won't compile.</li> <li>Using a weak name invites the possibility of "DLL hell." Once you use strong names then it's safe to have multiple versions of the same assembly in your reference paths because the linker will only load ones that match every criterion. In addition, if you decide to update some assemblies in place (instead of adding copies), then you'll be notified of any breaking changes at compile time instead of <em>whenever the bugs start coming in.</em></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload