问题
I have been receiving this error for a while when using devenv on an automatic build. I have gone through every website I can find, and the usual answers mention refreshing dependencies (Which I believe fixes it for manual deployment, but not for automatic) and removing the source control coding from the projects, which hasn\'t helped me.
The error does not occur every time I build, but it seems random on different deployment projects each time.
Does anyone have any advice on why exactly this error occurs and how to go about fixing it?
回答1:
This is a known issue in Visual Studio 2010 (a race condition). See this connect item.
We've run into this as well, and had a very unsatisfying support call on this issue with Microsoft. Long story short: it's a known issue, it won't be solved, and Microsoft advises to move away from Visual Studio Setup projects (.vdproj).
We've worked around this issue by triggering the MSI build a second time when it fails a first time. Not nice, but it works most of the time (error rate is down from ~ 10% to ~ 1%).
回答2:
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.
Following the recipe for v1.0.0.0 from MS finally made it work for me:
Microsoft Visual Studio Installer Projects
Unfortunately we couldn't address all cases of the command line issue for this release as we're still investigating the appropriate way to address them. What we do have is a workaround that we believe will work for almost all of them. If you are still suffering this issue then you can try to change the DWORD value for the following registry value to 0:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\MSBuild\EnableOutOfProcBuild
(VS2013)
orHKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\MSBuild\EnableOutOfProcBuild
(VS2015)
If this doesn't exist you can create it as a DWORD.
回答3:
Update as of 6/14/2017
the Microsoft Visual Studio 2017 Installer Projects extension now includes a command line helper tool for making the registry setting much easier to apply Microsoft Visual Studio 2017 Installer Projects
Example paths of the tool (based on the version of Visual Studio installed)
Professional Edition:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe
Community Edition:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe
From the README
This simple tool is meant to help users set the registry key needed to get around this error that can appear when building installer projects using command line builds:
ERROR: An error occurred while validating. HRESULT = '8000000A'
The tool is meant for Visual Studio 2017+ and sets this reg key for a particular installed Visual Studio instance for the current user. So if you're setting this on a build agent make sure to use the user account that the build will use.
Run "DisableOutOfProcBuild.exe help" for usage details.
回答4:
I read somewhere online about this, and I have fixed it like this (it was suggested by someone):
- 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 - 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.
回答5:
Permanent solution (+ for build-machines)
Visual Studio 2017
For VS 2017, call the following CMD scripts under your target Windows account:
Community edition
Professional edition
Enterprise
edition
TL;DR. Notes for poor DisableOutOfProcBuild.exe
, the Microsoft's offered solution that I use for VS 2017.
DisableOutOfProcBuild.exe
doesn't assume you will call it out of its installation folder. So, you can't copy this .exe file. (By the way, if you want to build .vdproj, you must install VS.)DisableOutOfProcBuild.exe
will only work if the current CMD directory is set to the installation location of DisableOutOfProcBuild.exe.
As an example, for VS Professional edition we must call
CD "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild"
CALL DisableOutOfProcBuild.exe
Visual Studio 2015 and earlier
by CMD for the current Windows user
For many people the creation/correction under HKEY_CURRENT_USER\..
doesn't always work or work permanently.
Trying to solve this, I found that in fact I have to create/change some weird key under HKEY_USERS HKEY_USERS\S-1-5-xx-xxxxxxxxxx-xxxxxxxxx-xxxxxxxxxxx-xxxxx\...\MSBuild
But I also found that if I will be using a CMD console for HKCU
with the proposed fixREG ADD HKCU\SOFTWARE\Microsoft\VisualStudio\14.0_Config\MSBuild /t REG_DWORD /v EnableOutOfProcBuild /d 0 /f
this will write the value exactly into that weird key HKEY_USERS\S-1-5-xx-xxxxxxxxxx-xx..., not to the HKEY_CURRENT_USER.
So, this works from a first shot and forever. Just use the CMD console.
REG ADD HKCU\SOFTWARE\Microsoft\VisualStudio\14.0_Config\MSBuild /t REG_DWORD /v EnableOutOfProcBuild /d 0 /f
@REM (use 12.0_Config for VS2013)
Solver for Build Servers
On the other hand this code always works for a current user account which launches it (because of HKEY_CURRENT_USER). But build-servers often use dedicated accounts or Local System, etc.
I fixed it on my build-machines by adding the following simple batch file to my build tasks (Jenkins, TeamCity, CruiseControl)
VS-2015, VS-2013, VS-2017-Community, VS-2017-Professional, VS-2017-Enterprise
回答6:
As pointed out in the comments here, for VS2017 you will need to create the DWORD HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0_[IDKey]_Config\MSBuild\EnableOutOfProcBuild Replace [IDKey] with the ID suffix of the existing 15.0 subkey of VisualStudio.
For example, if under VisualStudio you see the key "15.0_abcd1234" it would be "15.0_abcd1234_Config".
回答7:
The hotfix is now uploaded on here:
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=33186
you can read about it here:
http://connect.microsoft.com/VisualStudio/feedback/details/595632/inconsistent-hanging-with-devenv-2010
回答8:
I have faced with this issue after I moved my project to another PC(VS 2010, multiple projects in a solution).
It was already built my project in the source computer but after I copied to target, I wasn't be able to build my Setup Project and having this error.
I opened the /Debug
folder under my Setup Project root path, there were MyProject.msi
and setup.exe
files, I deleted them and built my project again, it worked. Hope it works for some fellas, too.
回答9:
Checking the project dependencies may help.
In VS 2010 right click in your solution explorer then click Detected Dependencies and Refresh Dependencies, it sometime resolves the problem.
回答10:
I am using VS 2017 but none of above solution work. So, upgraded latest version of VS 2017 and apply @AussieAsh solution and its work fine...
I hope this solution may someone will work.
回答11:
with me it was caused by a wrong .suo file. ( caused by skydrive ) deleting this file solved the problem.
回答12:
Visual Studio 2017 stores the information previously stored in the public registry within a new private registry: C:\Users\\AppData\Local\Microsoft\VisualStudio\15.0_6de65198\privateregistry.bin
This is where you need to add the EnableOutOfProcBuild as per the instructions for VS2013/VS2015.
To update the private registry you can use Regedit.
Click to select the HKEY_USERS node.
Select File > Load Hive and navigate to the privateregistry.bin file. When you select it Regedit will ask for a name - it doesn't matter what you call it as we will soon be done.
Now the registry structure will appear and you can navigate down to the Microsoft\VisualStudio\15.0_Config\MSBuild
Create a new DWORD EnableOutOfProcBuild with a value of 0.
Once done select the hive's root (whatever you named it earlier) and use File > Unload Hive to detach from it.
Now it should work :o)
回答13:
My Visual Studio 2013 somehow became Experimental so it started using another registry key for EnableOutOfProcBuild
To be sure I just added another line in my batch file for setting the registry value and it started working:
REG ADD HKCU\SOFTWARE\Microsoft\VisualStudio\12.0_Config\MSBuild /t REG_DWORD /v EnableOutOfProcBuild /d 0 /f
REG ADD HKCU\SOFTWARE\Microsoft\VisualStudio\12.0Exp_Config\MSBuild /t REG_DWORD /v EnableOutOfProcBuild /d 0 /f
回答14:
Just run this exe
(Visual Studio 2017 Community edition)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe
(Visual Studio 2017 Enterprise edition)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe
回答15:
Okay I looked into this issue until I was blue in the face, red in the face, losing my hair, and losing my mind, and tried every step I could find. :-D
My solution for Visual Studio 2017 / TeamCity was a combination of the two solutions from @it3xl and some assistance from @Night94.
The issue seemed to be that the registry key for the TeamCity user was missing.
- Running
DisableOutOfProcBuild.exe
as mentioned by @AussieAsh therefore didn't work as it added the registry key for my user only. - using the script mentioned by @it3xl also failed when run from TeamCity
The solution was therefore to add the following as a command line build step from TeamCity before MSBuild:
REG ADD HKCU\SOFTWARE\Microsoft\VisualStudio\15.0_2c79e3fe_Config\MSBuild /t REG_DWORD /v EnableOutOfProcBuild /d 0 /f
Once this step ran, it could then be removed if required.
Solution summary
Either:
- run
DisableOutOfProcBuild.exe
as the TeamCity user, or - navigate to the registry key
HKCU\SOFTWARE\Microsoft\VisualStudio
and check the version listed, then amend the aboveREG ADD
to match the versions (remember to add_Config
) as a step in the TeamCity build.
Again the above should only have to be done once. You could disable to step in TeamCity leaving it for reference should you run into the issue again.
回答16:
Had this problem today, try restarting Visual Studio, if that doesn't do it create a new project, save it and then copy the files from the problem project over. both methods worked for me.
回答17:
Please clean the solution first, build the solution and than try to build the installer. It will remove the error.
来源:https://stackoverflow.com/questions/8648428/an-error-occurred-while-validating-hresult-8000000a