问题
I have a setup and deployment project that, on our build server, reports the following in the summary:
========== Rebuild All: 25 succeeded, 2 failed, 0 skipped ==========
I don't know what the two are that failed, though I believe one of them is the vdproj project because if I run the build without the installer there are no errors reported at all. The "packaging file" messages match the output on my PC, where the build completes successfully.
I'm convinced it's an environment thing, just that there are no logs anywhere that say what the problem was - just the number in the summary.
Even stranger is that the setup.exe
and myapp.msi
files appear to be generated fine. I can't work out what the projects are that failed, because there's no mention of a failed project. All I know is that if I build the solution excluding the setup project the summary says there were no errors.
Can anyone think of anything to check?
回答1:
The answer in the end was that it is a known bug: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=317870
The answer is to modify project files (*.csproj) containing LINQ to SQL dbml files to remove some stuff, as follows:
- Close VS 2008.
- Open the project file containing the LINQ To SQL item in Notepad.
- Remove the following lines:
[ItemGroup]
[Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}"/]
[/ItemGroup]The Setup Project will now build successfully. However, if you double-click the DBML file to open the designer in VS 2008 the Setup Project will stop building again. The above lines do not get re-added to the project file but the Setup Project will stop building anyway. Just restart VS 2008 and it will work again -- until you open the DBML designer again. Once the Setup Project fails due to this problem it will never build successfully until after you restart VS 2008.
I eventually found the answer (or at least the link to the answer) from the MS Connect forum topic. Here's the documented workaround.
回答2:
(You did not say what Kind of Build Server you have. Because you tagged ".net" I am going to assume you are using TFS and Team Build.)
Team Build uses MSBuild (really it IS MSBuild). MSBuild cannot build vdproj files. Only Visual Studio can do that.
So if you are including solutions that that include vdproj files then they will fail. (Check your build log around the vdproj projects to see if they failed.)
One way to stop these failures from registering is to create a configuration that you compile for your Team Build that does not include your vdproj files (if the failed projects are really bugging you).
The best way to get your msi and exe files are to run Visual Studio on your vdproj projects. Add a custom target after the build has finished and call Visual Studio manually on your project. (I don't know why your msi and exe files are being generated unless you are doing this.)
As an alternative consider Windows Installer XML (WIX). Version 3 (which is very very close to full release and has a stable beta out) uses MSBuild. This means that your solutions can be compiled via Team Build with out any special actions. The only drawback is that WIX cannot target 'Any CPU', but it can be part of a Solution Level target of 'Any CPU' as long as it is targeting a specific platform.
回答3:
yeah, I've had this before.
Not sure about your set up, but try this is appropriate:
Firstly, right-click on your Solution file > Properties > Configuration
In there, use the build tick boxes to experiment with which projects build together, and which don't.
Also, in your file system, delete the debug/release folders for all of your projects.
Finally, in my experience, this error is usually caused by a corrupt/missing web.config.
let me know how you go
回答4:
In my case the project failed to build because of incorrect version format ("Version" project properties). The accepted format is X.X.X like 1.0.0 When i change it to 1.0.0.0 the project will fail to build.
来源:https://stackoverflow.com/questions/847893/visual-studio-setup-and-deployment-build-fails-with-no-errors