The postbuild gacutil event exists with code 1

I am trying to register and collect in the GAC on an event after the build. Here is my post-build command

"C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Bin \ NETFX 4.0 Tools \ x64 \ gacutil.exe" / if "$ (TargetPath)"

I am on x64 / Windows 7 / VS2010. I run VS2010 as an administrator and I have UAC disabled (which is almost everything my google-fu finds for this problem).

Post build comes out with code 1 for all 4 gacutil.exe instances that I can find on my machine.

Does anyone know about this? Thanks in advance.

+6
source share
6 answers

Copy the full command line of the post-build event (for example, "C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Bin \ NETFX 4.0 Tools \ x64 \ gacutil.exe" / if "D: \ ProjectFolder \ Project .Name \ bin \ Debug \ Project.Name.dll "to the clip, open the command line as administrator, insert the event after the assembly and press the enter key to execute. Descriptive explanation of the exit code.

In my case, my project was set to the wrong target structure. I switched it from .Net 4 to .Net 3.5 and the error went away.

Good luck

+10
source

Mine is usually decided by iisreset.

+2
source

DECISION:

Try running Visual Studio as ADMIN to install in the GAC ... :)

+2
source

It looks like your script message assembly is incorrect .... Try using "$ (DevEnvDir) .... \ SDK \ v2.0 \ Bin \ GacUtil.exe" / i "$ (TargetPath)" / e

+1
source

OS: Windows server 2012

. Frame work. 4.5

The path should be: C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v8.0A \ bin \ NETFX 4.0 Tools \ gacutil.exe

+1
source

I had the same problem, I was able to fix it:

  • Search and stop any other processes that have a handle open in the dll using Process Explorer
  • Removing an assembly using "gacutil / u AssemblyName"
  • Increasing assembly version number in project properties β†’ Assembly information

After these steps, my build step started working again.

0
source

Source: https://habr.com/ru/post/892531/


All Articles