Andrew Stopford's Weblog

poobah

Sponsors

News

Articles

Family

Old Blogs

MSBuild bug and web projects

A bug I have run into before was where MSBuild can't cope with changes to IIS virtual and physical paths in web project sln files. I have run into this again with the RTM.

When created the sln file contains referances to the IIS virtual path and its physical location, lets say

  • VirtualPath = \test which points as C:\test
  • PhysicalPath = C:\test

The virtual path then changes to C:\test2 and C:\test is deleted. If you compile in VS it seems to cope with this, MSBuild however states that C:\test cannot be found and fails the build. While true, the virtual path remains but it defaults to the PhysicalPath. To get around this you will need to edit the sln file manually and remove.

  • Debug.AspNetCompiler.PhysicalPath
  • Release.AspNetCompiler.PhysicalPath
  • alter these paths to the correct physical paths

VS2005 will honor your changes so you should only need to do this once.

Update: delete will screw up the compile process in copying bin folders, use the fix suggested instead.

Comments

BradleyB said:

A better approach would be to use the new Web Deployment Proejcts for VS2005. It's a full MSBuild project file for website projects. and it's free.

http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx
# November 10, 2005 3:30 PM

Carlton said:

Can you still just use a C# library project like you do in VS.Net 2003?
# November 10, 2005 3:42 PM

Andy Stopford said:

The deployer project does'nt fix this as its more to do with sln structure and how VS maintains it.
# November 11, 2005 9:23 AM