gacutil postbuild event exists with code 1

前端 未结 6 1557
广开言路
广开言路 2021-01-05 03:10

I am trying to register and assembly in the GAC on a post-build event. Here\'s my post-build command

\"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\

相关标签:
6条回答
  • 2021-01-05 03:56

    Looks like your post build script is incorrect....Try using "$(DevEnvDir)....\SDK\v2.0\Bin\GacUtil.exe" /i "$(TargetPath)" /f

    0 讨论(0)
  • 2021-01-05 03:59

    SOLUTION:

    Try to run Visual Studio as ADMIN to install things in GAC... :)

    0 讨论(0)
  • 2021-01-05 04:09

    OS: Windows server 2012

    .Net frame work 4.5

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

    0 讨论(0)
  • 2021-01-05 04:10

    Copy the full post-build event command string (e.g. ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\gacutil.exe" /if "D:\ProjectFolder\Project.Name\bin\Debug\Project.Name.dll" to the clip board, open a command prompt as an administrator, paste the post-build event, and press enter to execute. You'll get a more descriptive explanation of the exit code.

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

    Best of luck

    0 讨论(0)
  • 2021-01-05 04:12

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

    1. Finding and stopping any other processes that had a handle open on the dll using Process Explorer
    2. Uninstalling the assembly with "gacutil /u AssemblyName"
    3. Increasing the Assembly Version Number in Project Properties -> Assembly information

    After these steps my post build step started working again.

    0 讨论(0)
  • 2021-01-05 04:15

    Mine is usually solved by iisreset.

    0 讨论(0)
提交回复
热议问题