开发者

How do I automate the building of a vs2005 website with msbuild?

I'm working with an old visual studio 2005 web site (not web application project). The current goal is to replicate our manual process as part of our automated builds. It is not c开发者_开发知识库urrently an option for me to upgrade the project, create a web deployment project, or to change it to a web application project.

The simplest view of the current process is that a developer will build the solution on his box, publish the website to a location on his box, zip it up and hand it off to the release team.

I'm not looking to change the output of this process right now, just to automate it as part of our msbuild scripts.

The closest I've gotten so far is to use the AspNetCompiler task like this:

<AspNetCompiler
  PhysicalPath="website\"
  TargetPath="output\"
  VirtualPath="/"
  Force="true"
  Debug="true"
  />

However, this results in several errors like error CS0246: The type or namespace name 'FOO' could not be found (are you missing a using directive or an assembly reference?)


EDIT:

I should have mentioned this before but running msbuild on the solution with the rebuild target gives the same result.


I would rather use MSBuild.exe itself - either (1) build & publish with publish directory set to your destination folder OR (2) build and xcopy bin folder, aspx/asmx/svc files and config (assuming you have the Website configured at IIS on your destination machine).


I once described how to use a combination of aspnet_compiler and aspnet_merge for this scenario.


It looks to me like the error is actually related to the fact that your project won't compile, rather than an issue with your MSBuild.

Either that or you are using a lower version of the compiler (that's usually when it starts playing up about references that are clearly there).

Make sure you are using the appropriate version of MSBuild that matches the version you are using in your project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜