ASP.NET Web Application Build Output - How do I in

2019-02-26 02:45发布

When I build my ASP.NET web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as the result of each build? Trying to pick the right files out of the source directory is a pain.

The end result should be xcopy deployable.

Update: I don't want to have to manually use the Publish command which I'm aware of. I want the full set of files required by the application to be the build output - this means I also get the full set of files in one place from running MSBuild.

9条回答
我命由我不由天
2楼-- · 2019-02-26 02:50

Have you tried using the aspnet_compiler.exe in your .net framework directory? I'm pretty sure you can create a "deploy ready" version of a web application or web site.

查看更多
地球回转人心会变
3楼-- · 2019-02-26 02:50

Build --> Publish

A dialog box will appear that will guide you through the process.

查看更多
Animai°情兽
4楼-- · 2019-02-26 02:52

You can Publish Web site..If you want to automate your deployment, you need to use some script.

查看更多
看我几分像从前
5楼-- · 2019-02-26 02:52

For the automated building you describe in the update, I would recommend you look into MSBuild and CruiseControl.NET

查看更多
闹够了就滚
6楼-- · 2019-02-26 02:57

Have you tried right clicking the website in Solution Explorer and clicking 'Publish Website'?

查看更多
beautiful°
7楼-- · 2019-02-26 02:59

The _CopyWebApplication target on MSBuild will do exactly what you need. The catch is that only the main assembly will be copied to the bin folder and that's why a copy task is needed to also copy any other file on the bin folder.

I was trying to post the sample script as part of this post but wasn't able to.

Please take a look at this article on my blog that describes how to create a MSBuild script similar to the one you need.

查看更多
登录 后发表回答