MSBuild: Building asp.net 4.0 web sites: .metaproj -files
I have a solution-file with ASP.NET Web Sites.
When I build the solution with .NET 4.0 Beta 2 using
"c:\WINDOWS\Microsoft.NET\Framework\v4.0.21006\MSBuild.exe" d:\MyPath\MySolution.sln
Everything works fine, no errors. Then I try to build the same solution with CruiseControl .NET task (msbuild-script ran by a service), the same solution fails with:
D:\MyPath\MyWebSite.metaproj (,): errorMSB4025: The project file could not be loaded. Could not find file 'D:\MyPath\MyWebSite.metaproj'.
Of course, there is no file like that. I guess *.metaproj is a .csproj-like msbuild-file generated dynamically for web sites...
But I don't know how to fix the error... I tried to google metaproj-files with no luck. I did try to make the file manually, I inserted a <Project> with <Task Name="Rebuild"> and the compilation didn't raise any errors, but I guess the site开发者_Go百科 didn't compile.
The same machine has .NET 3.5 and .NET 4.0 projects and environment variables for both frameworks.
There is a way around this if you can get rid of project dependencies in the solution file. You can keep project dependencies in the project file but remove them from the solution file. See this link for the this
Answer.
I am getting the same problem with tfs 2008 build server. Once I switched the tfs builder server config to use 4.0 msbuild I started getting this same problem. If I run the msbuild manually its fine and it says in the log its building a metaproj file, but in the automated build process it fails.
Russ
I read CruiseControl discussions and tried to run same commands as CruiseControl.net does and I solved my case so that I moved my
Spaces in directory names makes msbuild to fail under Cruise Control !! ??
So I give explicitely directories for Cruise control without spaces. Example below.
<Project name="ProjectNameHere">
<workingDirectory>c:\dev\work\ProjectNameHere\WorkDir</workingDirectory>
<artifactDirectory>c:\dev\work\ProjectNameHere\Artifacts</artifactDirectory>
...
Visual Studio 2010 final release fixed this bug.
I first created a my_website.metaproj beside the my_solution.sln that looked like this:
<Project DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build">
<Message Text="Building...but nothing to build" />
</Target>
<Target Name="Test">
<Message Text="Testing...but nothing to test." />
</Target>
<Target Name="Clean">
<Message Text="Cleaning...but nothing to clean." />
</Target>
</Project>
Then it complained about not finding sgen.exe. I installed Visual Studio 2010 Beta 2 on the build agent and it looks like it is working now.
[Edit] This actually didn't completely work. It wasn't pulling the dependencies of the website project to its bin directory.
What we ended up doing was scraping the upgrade build process and redoing the build process with a variation of the standard template. This worked fine.
In VS2013 switching from the DefaultTemplate to the TfvcTemplate.12 worked for me!
Some information on the TfvcTemplate.12 here http://blog.qetza.net/en/2013/10/03/new-features-in-team-build-2013/
精彩评论