Visual studio:为一些web项目禁用web开发服务器。

时间:2022-09-01 08:11:56

I'm working on a web platform which uses ASP.NET MVC and supports plugins. In this platform, each plugin is a folder under /Plugins folder. For example, plugin A's virtual path is /Plugins/PluginA.

我正在开发一个使用ASP的web平台。NET MVC,支持插件。在这个平台中,每个插件都是/Plugins文件夹下的一个文件夹。例如,插件A的虚拟路径是/Plugins/PluginA。

In development, one plugin is one separated asp.net mvc web application. To make plugin development easier. I create plugin projects in the same solution where the main project (the platform) is in. At runtime, the platform will dynamically load the assemblies in the plugin project's bin folder.

在开发中,一个插件是一个分离的asp.net mvc web应用程序。使插件开发更容易。我在主项目(平台)所在的相同解决方案中创建插件项目。在运行时,平台将动态加载插件项目的bin文件夹中的程序集。

The problem is, every time I debug the main project, visual studio will start many web development servers (one for main project, and one for each plugin project).

问题是,每次调试主项目时,visual studio都会启动许多web开发服务器(一个用于主项目,一个用于每个插件项目)。

So if I have 20 plugins, visual studio will start 21 development server. It makes my computer slow. So, if there's a way to disable the development server for plugin projects, that is, let visual studio start only one development server when debugging?

如果我有20个插件,visual studio将启动21个开发服务器。它让我的电脑慢了。那么,如果有一种方法可以禁用插件项目的开发服务器,也就是说,让visual studio在调试时只启动一个开发服务器?

BTW: I still need the intellisence for the Razor views in plugin projects.

顺便说一句:在插件项目中,我仍然需要剃刀视图的灵活性。

2 个解决方案

#1


23  

Click on the web project that you don't want to start the web dev server, press F4 to bring the properties tab, and there you will find an "Always Start when debugging" option that you should set to false.

单击不想启动web开发服务器的web项目,按F4来打开properties选项卡,您将发现一个“总是在调试时启动”选项,您应该将其设置为false。

#2


1  

There is an extension tool to enable web server for selected project(s)

有一个扩展工具可以为选定的项目启用web服务器

just right click on your project(s) and choose "Enable web server for selected project only".

只需右键单击您的项目并选择“仅为选定的项目启用web服务器”。

multi selection is also supported

还支持多选择

#1


23  

Click on the web project that you don't want to start the web dev server, press F4 to bring the properties tab, and there you will find an "Always Start when debugging" option that you should set to false.

单击不想启动web开发服务器的web项目,按F4来打开properties选项卡,您将发现一个“总是在调试时启动”选项,您应该将其设置为false。

#2


1  

There is an extension tool to enable web server for selected project(s)

有一个扩展工具可以为选定的项目启用web服务器

just right click on your project(s) and choose "Enable web server for selected project only".

只需右键单击您的项目并选择“仅为选定的项目启用web服务器”。

multi selection is also supported

还支持多选择