Why do I get “An error occurred while validating.

2019-01-17 20:38发布

Why do I get the following error when building a setup project?

An error occurred while validating. HRESULT = '80004005'

11条回答
不美不萌又怎样
2楼-- · 2019-01-17 21:02

In my case I had installed Visual Studio 2010 alongside Visual Studio 2008. My setup project, when opened in Visual Studio 2008 gave the same error, but was OK in Visual Studio 2010.

If copied to another machine that did not have Visual Studio 2010, but did have Visual Studio 2008, then it would compile.

查看更多
The star\"
3楼-- · 2019-01-17 21:03

I have spent enormous time on this one myself, though none of the above worked. But I have found another solution with a registry hack, you need to add a new DWORD (EnableOutOfProcBuild) value of (0) to HKCU\SOFTWARE\Microsoft\VisualStudio\14.0_Config\MSBuild\EnableOutOfProcBuild

Note: this is for Visual Studio 2015

查看更多
时光不老,我们不散
4楼-- · 2019-01-17 21:03

I know this is kinda old news, but my particular issue and solution are not specifically stated here (as far as I can tell - if I missed it, I apologize).

I had same problem. It would not compile my project, but had no errors. All I could see was "Build Failed". I opened up the "Output" file (Click View--> Output on menu), and it told me exactly which reference (in my case a .dll) was causing the problem.

I deleted and recreated the reference and it changed the reference name from Microsoft.Office.Core (which was appearently only a 32 bit version) to "OFFICE". Then everything worked great. -- Make sure to make a note of the path to the file you are referencing in the properties window... My new path was exactly the same, but the reference name changed anyway.... still scratching my head on that one...

So the moral of the story is... When you get no errors and your build fails, check the "Output" tab and it might help.

查看更多
叛逆
5楼-- · 2019-01-17 21:04

This error is related to a dependency error. I removed all references to my primary output project and added them again. It now compiles OK!

查看更多
何必那么认真
6楼-- · 2019-01-17 21:06

One project in solution had ToolsVersion="4.0" (in .csproj file), changed it to ToolsVersion="3.5" and setup project builds fine.

查看更多
Deceive 欺骗
7楼-- · 2019-01-17 21:10

I read this answer from another post on Stack Overflow, and it has worked for me.

Open your setup project file (.vdproj) in Notepad (or any other text editor). Delete these lines at a beginning of the .vdproj file:

"SccProjectName" = "8:"
"SccLocalPath" = "8:"
"SccAuxPath" = "8:"
"SccProvider" = "8:"

Build again - the error is gone. That error didn't stop me from deploying, building, debugging (or anyting) my project; it just annoyed me. And it came on even if I set all projects to be build in a current configuration and the setup project not to.

查看更多
登录 后发表回答