I moved a project from .NET 3.5 to .NET 4.6.1. Now when I try to build (with the following as my post-build event command) I get the this error:
gacutil -if "$(TargetPath)"
The command "gacutil -if "[xyz.dll]"" exited with code 1
I referenced this stack overflow answer: gacutil postbuild event exists with code 1
The problem appears to be the fact that there is a new version of the GacUtil that needs to be used with .NET 4.0 projects and above.
I determined that this is the path to my current gacutil. My Path environment variable is set to this:
C:\>where gacutil
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
After navigating to C:\Program Files (x86)\Microsoft SDKs\Windows, I see that there are several different SDKs versions to choose from.
- v7.0A
- v7.1A
- v8.0
- V8.0A
- V8.1
- V8.1A
- V10.0A
I assume I just choose the path to the gacutil in latest version?
What the new Path environment variable would be:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools