Welcome to the navigation

Quis incididunt eiusmod amet, voluptate velit ut dolore occaecat esse labore nisi fugiat reprehenderit anim dolore minim elit, ea commodo ut lorem enim veniam, qui. Laborum, sunt sint magna enim cupidatat aliquip dolor velit id consectetur aliqua, duis consequat, eu elit, veniam, est commodo ut adipisicing sed irure dolore deserunt

Yeah, this will be replaced... But please enjoy the search!

Failure adding assembly to the cache: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Categories Tags

So you got the "Failure adding assembly to the cache: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." when running Gacutil.

Well good news is that this is easy to fix, you are simply executing an old version of gacutil. It is quite common in development environments to have multiple versions of gacutil, befin by finding out which one you currently are using. Open PowerShell and enter

(Get-Command "gacutil.exe").Path

 

Figuring out what's available

To find any installed versions of Gacutil the command below may help you

# Find all gacutil.exe's in the 'C:\Program Files (x86)' folder
(Get-ChildItem -Path 'C:\Program Files (x86)' -Filter gacutil.exe -Recurse) | Select-Object { $_.FullName }

Most of my machines this will return something similiar like below

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\gacutil.exe 
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe

Either execute the appropriate version of Gacutil from it's directory or link that directory to the environment path.