Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change reference path from GAC to folder at compile time

I have a project that depends on some 3rd party libraries. These assemblies are registered int the GAC. Everythings works fine so far. But when building the project on the build server, the 3rd party assemblies are not in the GAC, but in an extra folder (called external) that is also in the SVN-repository the build server uses.

The build will fail due to the fact that MSBuild can't find these assemblies. Is there a way to tell MSBuild on the buildserver to use the assemblys from this folder instead of the GAC?


1 Answers

The best practice is NOT to reference 3rd-party assemblies from the GAC on build time. Instead, have all 3rd-party assemblies referenced from a common source controlled folder.

If you open the projects with an editor, ideally you will have a HintPath for each 3rd-party reference. I.e:

<Reference Include="Microsoft.Practices.Unity">
  <HintPath>..\..\..\3rd Party\Prism4\Microsoft.Practices.Unity.dll</HintPath>
</Reference>
like image 131
KMoraz Avatar answered Jan 29 '26 11:01

KMoraz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!