gacutil postbuild 事件存在代码 1 [英] gacutil postbuild event exists with code 1

查看:16
本文介绍了gacutil postbuild 事件存在代码 1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在构建后事件中在 GAC 中注册和组装.这是我的构建后命令

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\NETFX 4.0 Tools\x64\gacutil.exe"/if "$(TargetPath)"

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

我使用的是 x64/Windows 7/VS2010.我以管理员身份运行 VS2010 并且我关闭了 UAC(这几乎是我的 google-fu 为这个问题找到的所有内容).

I am on x64/Windows 7/VS2010. I am running VS2010 as an administrator and I have UAC turned off (which is pretty much all that my google-fu is finding for this problem).

对于我可以在我的机器上找到的所有 4 个 gacutil.exe 实例,post build 正在退出,代码为 1.

The post build is exiting with code 1 for the all 4 instances of gacutil.exe I can find on my machine.

有人知道解决这个问题的方法吗?提前致谢.

Anyone know a way around this? Thanks in advance.

推荐答案

复制完整的构建后事件命令字符串(例如 ""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" 到剪贴板,以管理员身份打开命令提示符,粘贴post-build事件,然后按 Enter 键执行.您将获得有关退出代码的更具描述性的说明.

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.

就我而言,我的项目设置为构建到错误的目标框架.我将它从 .Net 4 切换到 .Net 3.5,错误消失了.

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.

祝你好运

这篇关于gacutil postbuild 事件存在代码 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆