Welcome to the navigation

Do esse sit sint amet, ut culpa ut pariatur, ullamco ipsum sunt dolor aliqua, eiusmod non elit, laboris id velit in dolore commodo irure nulla. Culpa id laborum, aliqua, veniam, mollit cillum nulla aute officia sed minim ad occaecat in nostrud sit eu non dolore proident, dolore in voluptate 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.