[英]Prevent iisexpress from running the websites in a solution when the startup app is a console app
I have a solution with a number of projects in it. 我有一个包含许多项目的解决方案。 Even if I set the web project's start options to:
即使我将web项目的启动选项设置为:
http://localhost
. http://localhost
。 And the startup project to: 启动项目:
When I press start debugging, IIS express launches (shows up on the taskbar). 当我按下开始调试时,IIS express启动(显示在任务栏上)。 How do I prevent from IIS Express from launching?
如何阻止IIS Express启动? I am only running a console application, and don't want IIS Express running.
我只运行一个控制台应用程序,并且不希望IIS Express运行。
In fact, all of the websites in the solution launch in IIS, and they consume resources on my machine unnecessarily. 实际上,解决方案中的所有网站都在IIS中启动,并且它们不必要地消耗我机器上的资源。
In the Property Pages-> Start Options: Set Start Action = "Don't open a page..."; 在属性页面 - >开始选项:设置开始操作=“不要打开页面...”; Set Server -> Use custom server and leave Base URL blank.
设置服务器 - >使用自定义服务器并将基本URL留空。
For Visual Studio 2013, I configured it like this: 对于Visual Studio 2013,我将其配置如下:
Start Action: Don't open a page. 开始动作:不要打开页面。
Servers: External Host 服务器:外部主机
Project Url: http://NotAStartupApp/ 项目网址: http:// NotAStartupApp /
I uninstalled IIS Express in windows and it worked for me. 我在Windows中卸载了IIS Express,它对我有用。 After publishing my files from VS, automatically my settings changed to point to IIS Express and it wont change to IIS, no matter what, for my Website project.
从VS发布我的文件后,我的设置自动更改为指向IIS Express,无论如何,我的网站项目都不会更改为IIS。 Hope this works for someone.
希望这适用于某人。
To extend @Aleksey L.'s answer, you can actually do this with a plain text editor like Notepad. 为了扩展@Aleksey L.的答案,您实际上可以使用像记事本这样的纯文本编辑器来完成此操作。
In your projectname.csproj.user
file, make sure your the AlwaysStartWebServerOnDebug
node has a value set to False
. 在
projectname.csproj.user
文件中,确保AlwaysStartWebServerOnDebug
节点的值设置为False
。
projectname.csproj.user projectname.csproj.user
<Project >
<ProjectExtensions>
<VisualStudio>
<FlavorProperties>
<WebProjectProperties>
..
<AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
..
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
Alternatively, to do this without a text editor you can use Powershell 或者,要在没有文本编辑器的情况下执行此操作,您可以使用Powershell
$file = 'projectname.csproj.user'
$x = [xml] (Get-Content $file)
$x.Project.ProjectExtensions.VisualStudio.FlavorProperties.WebProjectProperties.AlwaysStartWebServerOnDebug = 'False'
$x.Save($file)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.