Configuration of publishing an ASP.NET web site

牧云@^-^@ 提交于 2019-12-14 01:36:48

问题


Forgive my ignorance, though I am new to this. I've search a lot but can't seem to come to a definite conclusion, so any information is appreciated.

So to the question: Is there a built-in configuration for web site publishing in MS Visual Studio called "Release"? The reason I'm asking is that some have told me it is, but I can only find the "Debug" configuration in Visual Studio.

So, if there's supposed to be a "Release" as well, how can I get it or can I manually add a new equivalent?


回答1:


Go to the Solution Explorer (CTRL+W+S), then find your project. Right click on it and go to its properties. Find the Build tab. The top of the window will contain the active build configuration for your project. You can then change from debug (the default) to release.

By default, projects have two configurations: release and debug. You can make more, but first learn more about those two. The most important differences are explained in the question linked by Nacho in the comments. Good luck and happy codding.

edit: Web Site projects don't have the Release configuration available, but it makes no difference since they are not compiled. Web Application projects, on the other hand, do get compiled and have both configurations available.




回答2:


It's been a long time (~4,5 years), but I think I might have used a Web Deployment Project for a Web Site Project once, for changing config files (replacing by copying from another directory) (xml node: WebConfigReplacementFiles)

I used Web Deployment Projects before web.config transforms where invented. (If you are interested in web.config transforms, check out my tutorial for VS 2010: http://www.tomot.de/en-us/article/5/asp.net/how-to-use-web.config-transforms-to-replace-appsettings-and-connectionstrings)

Another useful link might be: http://msdn.microsoft.com/en-us/library/377y0s6t(v=vs.100).aspx



来源:https://stackoverflow.com/questions/20357871/configuration-of-publishing-an-asp-net-web-site

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