views:

635

answers:

5

Hi!

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 didn't compile.

The same machine has .NET 3.5 and .NET 4.0 projects and environment variables for both frameworks.

+1  A: 

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

Russ Kahler
A: 

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"&gt;

  <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.

Mark
Hmm.. As I described, I added Rebuild-task also. But it didn't help: Actually I'm using a TargetPath-property (in .sln-file) to publish release-version of the Web Site. With this null-task it didn't build the web site.Also, I'm using CC.NET, not TFS, so there is no "standard template".
Tuomas Hietanen
+2  A: 

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.

Russ Kahler
This worked for us as well.
Mark
Web sites don't have a project file. The references are stored in web.config (if it is a web application). I'm currently using the sites without web.configs. I will try to convert those project references to binary references, but there are like 40 websites, so I haven't have time to test that yet.
Tuomas Hietanen
A: 

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> ...

Eino Mäkitalo
Hmm... Maybe "Map network drive" \\localhost\c$\... would help.Anyways, sorry, I have had a lot of other things to do so I haven't had time to test every possible solution... I hope that .NET 4.0 RC or final version would fix this.
Tuomas Hietanen
+1  A: 

Visual Studio 2010 final release fixed this bug.

Tuomas Hietanen