Monday, 26 September 2011

Install new version of .net framework sdk to run gacutil

if following message is shown when running gacutil
"this assembly is built by a runtime newer than the currently loaded runtime"

This mean Gac utillity verion being installed on machine is older then the version the assembly being built in my case assembly was of .net framework 4.0,

Solution:
Install the latest version of .net framework sdk.

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279

use following path to run the gac

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools

execute the following command

gacutil -i "c:\assemble.dll"

the gac folder path is
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\

to list all the assemblies in the gac

gacutil -l

to list all the assemblies in the gac into a file
gacutil -l  > "c:\assembliesfile.txt"


to look for a specfic assembly in the gac
gactuil -l "assemblyname.dll"

.Net 4 gac path "%windir%\Microsoft.NET\assembly\"
.Net2 gac path "%windir%\assembly\GAC_MSIL"

to find the public token key
sn -T EdmGen.exe
Public key token is c11d6c2346788e890

6 comments: