Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference non-GAC version of DLL in Visual Studio 2010

This is similar to Add Non-GAC reference to project but the solutions presented there don't seem to help.

I have a WinForms UI Library (Krypton from ComponentFactory) installed in the GAC. There's a bug I want to track down in that library, so I added the source code to my solution, removed the old references from my WinForms project to Krypton DLLs, added them back as a project references, ensured Copy Local is set to true, double-checked that the path (on reference properties tab) points to my local project, and...

...the GAC version is still being used while debugging. I cannot set a breakpoint in the Krypton source, Debugger.Break() or other code changes to not execute, and when I start the Visual Studio 2010 debugger, I see a Loading from ... GAC_MISL message relating to the Krypton DLLs flash by in the VS 2010 status bar. The DLLs are not copied to the WinForm's Debug folder.

How can I reference the "project" version of the files while debugging while leaving them registered in the GAC?

like image 638
Eric J. Avatar asked May 26 '10 21:05

Eric J.


People also ask

How do I change the reference version in Visual Studio?

Open the project in Visual Studio. Right-click on the project's References folder and select Add Reference to open the Add Reference dialog box. Locate the new assembly version in the Add Reference dialog for each Infragistics assembly listed in your References folder.


1 Answers

The CLR will always look in the GAC first. Don't hesitate to use gacutil.exe /u to remove them. Hacking the [AssemblyVersion] would work too so that the GAC copy won't be a match.

like image 179
Hans Passant Avatar answered Oct 20 '22 01:10

Hans Passant