This error is given by the gacutil.exe if you try to register in GAC an assembly built with Framework 4.0 and you are using the gacutil.exe built for Framework 2.0.
The programs I develop don’t register any assembly in GAC when installed on an end user machine, except if there is the need to expose .Net function to a .COM application.
On the development machines instead, all the general purpouse libraries of my organization are installed in GAC, this is made to avoid versioning problems in projects that are using more than one solution, and are modified in different moments of the developer working time.
To register the libraries in GAC we use the gacutil.exe from a Post Build Event, the gacutil.exe has been conveniently copied in c:\windows to have it in the standard “PATH” environment variable.
Trying to register in GAC an assembly produced with framework 4.0 I’ve received the message put in the title and my assembly was not registered in the GAC.
The problem is due to the fact that the gacutil.exe I’m using was the version built for framework 2.0, which works correctly until framework 3.5. (since 2005). After some searches on the internet, where it is told that the utility ships with Visual Studio, I made a dir /s on my c:\ drive and found the new release of the utility here:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools
Copying the new utility and replacing the old one, my assemblies made with framework 4.0 are correctly registered in GAC. However, there is something different from before, the folder where the GAC was until framework 3.5,
c:\Windows\Assembly
is now replaced by:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL
This is completely transparent for us Users, but probably it is the reason of the gacutil.exe upgrade we need to do.
The new version registers correctly the dlls made with older frameworks too.