I have a legacy project in Visual Studio 2003 that was made in the past by other developers.
This project has some references added. One of them, let's say myDLL.dll. It has the properties below in VS:
- Copy Local = True
- Runtime Version v1.1.4322
- Strong Name: True
- Type: Assembly
- Version: 2.1.1.30200
I build the solution and copy it in the target path in production machine. In the target I have ensured that myDLL.dll is the same version as in the VS solution, that is, 2.1.1.30200.
When I executed the new version of the app in production machine below error is shown in my app logs:
The located assembly's manifest definition with name 'myDLL' does not match the assembly reference.
I guess that in GAC is loaded/installed a previous version of this DLL so hence the above exception.
So, I wonder if GAC is automatically cleaned from time to time (on a regular basis) or do I need to remove manually the old DLL and install the new one?
If I need to remove the old one and install the new one in the production machine, how can I do it?
Additionally, if I go to C:\Windows\assembly in production machine I can find the DLL myDLL but the version indicated is 2.1.0.0 instead of 2.1.x.x. Why? Shouldn't it be 2.1.1.30200 (for the new one) or 2.1.1.20100 (for the old one)?
I have read a lot of posts here, like below ones:
- DLL version mismatch
- Working with GAC
- Installing DLL in GAC
- Viewing DLL in GAC
- Removing DLL from GAC
- What is GAC?
Other interesting links that I have found:
- .NET 4 gacutil on production server
- Automatically GAC an assembly after a build and include debug info.
but I am very newbie in GAC.