How to build a .NET website using Nant

跟風遠走 提交于 2019-12-07 14:06:37

问题


I usually use web applications in Visual Studio and the MSBUILD taks in Nant builds them without any problems:

<msbuild project="MySolution.sln">
  arg value="/property:Configuration=release" />
</msbuild> 

I now have a website (not a web application) in a VS Solution and it won't build - I get a lot of namespace errors.

Should I be able to build the solution with MSBUILD even though it contains a website? Or do I need to use CSC?


回答1:


You should try using the devenv.exe command if msbuild.exe is failing for you. Also you may be interested in Web Deployment Projects.

Sayed Ibrahim Hashimi

My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build




回答2:


In your MSBuild arguments use the OutDir option to set an output directory. You then get the following:

  1. All the DLLs in your project.
  2. A directory called _PublishedWebsite. This gives you the same output a Publish command in Visual Studio.

This is what we do to build our web apps through MSBuild.




回答3:


devenv.exe /rebuild debug mywebsite.sln

I found I had to use debug rather than release or the build was skipped.



来源:https://stackoverflow.com/questions/1147437/how-to-build-a-net-website-using-nant

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!