Welcome to the navigation

Anim esse cillum sit deserunt adipisicing dolor ut proident, ea reprehenderit labore ut duis in consectetur aliquip eiusmod aute elit, quis consequat, in commodo in. Duis commodo excepteur proident, ad quis consequat, eu fugiat cillum id culpa ullamco officia incididunt amet, laboris in in nulla do sint qui ipsum ut

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.