Prevent ASP.NET Website project from building certain directories by using Web.config?

爷,独闯天下 提交于 2019-12-05 22:43:00

问题


While programming, the longest part is a build on my ASP.NET Website project is the "Building directory" process seen below. (Note: I don't have the liberty to turn this into a Web Application with a .csproj build file. Wish I did.)

The contents of the directories seen below are not changing although there might be some dependencies in the App_Code/ subfolders that do change.

Is there any way for me to stop some directories from building using Web.config, to shorten a compile of my dev copy? It's the only viable file I can think of to use without having an official build file.

------ Build started: Project: C:\...\cmsappmin-abcd\, Configuration: Debug Any CPU ------
Validating Web Site
Building directory '/cmsappmin-abcd/abcd/controls/docsearch/'.
Building directory '/cmsappmin-abcd/abcd/controls/'.
Building directory '/cmsappmin-abcd/abcd/controls/pipco/'.
Building directory '/cmsappmin-abcd/abcd/controls/reg1000/'.
Building directory '/cmsappmin-abcd/abcd/TemplateC/'.
Building directory '/cmsappmin-abcd/abcd/Template/'.

回答1:


Right click on the website project in solution explorer, and select property pages.

Under Build, change the following settings:

  • Start action/Before running startup page - No Build
  • Build solution action - uncheck "Build Web site as part of solution"

That will stop Visual Studio from building any pages when performing a build. When WebDev.Webserver starts, your pages will now be built as and when you access each directory.



来源:https://stackoverflow.com/questions/2360310/prevent-asp-net-website-project-from-building-certain-directories-by-using-web-c

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