Error occured validating
Both of the reasons I found are already in other answers, but they are in separate answers and not fully explained.
So, hopefully this will combine the possibilities and give good means of debugging each.
Summary: unload any Visual Studio 2010 project in solution. 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). It would not compile my project, but had no errors. 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. Core (which was appearently only a 32 bit version) to "OFFICE". -- Make sure to make a note of the path to the file you are referencing in the properties window... When you get no errors and your build fails, check the "Output" tab and it might help.
In the VS2010 solution I had upgraded the project to . When I later realized the project was also used in another solution I downgraded it to . For some reason everything seemed to be changed correctly in the csproj file except one place which is mentioned here: Error in setup project HRESULT = '80004005' I know this is already solved somewhere else but I wanted to shed some light on this from another problem angle.
The error message "An error occurred while validating.
Does anyone have any advice on why exactly this error occurs and how to go about fixing it?
This is a known issue in Visual Studio 2010 (a race condition). We've run into this as well, and had a very unsatisfying support call on this issue with Microsoft.
What we do have is a workaround that we believe will work for almost all of them.
Not nice, but it works most of the time (error rate is down from ~ 10% to ~ 1%).
Update for those who got this issue for VS2013 or VS2015 after upgrading a VS200X setup project using the Microsoft Visual Studio Installer Projects extension.
My new path was exactly the same, but the reference name changed anyway.... 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).
Search for error occured validating:
If you are still suffering this issue then you can try to change the DWORD value for the following registry value to 0: That error didn't stop me from deploying, building, debugging (or anyting) my project it just annoyed me.