简体   繁体   English

在 Visual Studio 中从 IIS 打开网站会重新启动网站

[英]Opening website from IIS in Visual Studio restarts the website

I have a website in IIS and if I open it in Visual Studio (running as admin) the application pool always restarts - which is a big problem on my live server.我在 IIS 中有一个网站,如果我在 Visual Studio 中打开它(以管理员身份运行),应用程序池总是会重新启动——这在我的实时服务器上是一个大问题。 Can anyone help me prevent it from happening?谁能帮我防止它发生?

I realise precompiled web applications exist and that RDPing to live server and using VS like that is not ideal but I can't change that right now.我意识到存在预编译的 web 应用程序,并且 RDPing 到实时服务器并使用 VS 这样并不理想,但我现在无法更改。

My project is a VB website (no MVC - just.aspx pages) and I use Roslyn and all the new language features so I can't remove DotNetCompilerPlatform (I don't think choice of language or the code has anything to do with the problem).我的项目是一个 VB 网站(没有 MVC - 只是.aspx 页面),我使用 Roslyn 和所有新的语言功能,所以我无法删除 DotNetCompilerPlatform(我认为语言或代码的选择与问题)。 This happens on Windows 10 and Server 2016.这发生在 Windows 10 和 Server 2016 上。

From my investigation I found the following:根据我的调查,我发现以下内容:

VS 导致目录更改通知

It seems VS does SetSecurityFile on every file in /roslyn directory which triggers a NotifyChangeDirectory message.似乎 VS 对 /roslyn 目录中的每个文件执行 SetSecurityFile,这会触发 NotifyChangeDirectory 消息。 The permissions on the files remain the same - VS updates them for no apparent reason and that rightfully causes a recompile of the website.文件的权限保持不变 - VS 无缘无故地更新它们,这理所当然地导致了网站的重新编译。

I've cleaned out the NuGet package DotNetCompilerPlatform.我已经清理了 NuGet package DotNetCompilerPlatform。 I've tried applying loose permissions on the project directory (Everyone - Full Control).我尝试在项目目录上应用宽松的权限(每个人 - 完全控制)。 I've tried VS 2017, 2019 and the new 2019 preview.我已经尝试过 VS 2017、2019 和新的 2019 预览版。 Nothing helped so far.到目前为止没有任何帮助。 What I do know is that this didn't used to happen in the past.我所知道的是,这在过去没有发生过。

Any ideas would be appreciated.任何想法,将不胜感激。

The application pool will not automatically restart unless you set the recycling time or an error occurs, So please check if there are related errors in your Event Viewer.应用程序池不会自动重启,除非您设置了回收时间或出现错误,所以请检查您的事件查看器中是否有相关错误。 and try to change the startMode of your application pool to AlwaysRunning:并尝试将应用程序池的 startMode 更改为 AlwaysRunning:

  1. Open Internet Information Services (IIS) Manager.打开 Internet 信息服务 (IIS) 管理器。
  2. In the Connections pane, select the Application Pools node, revealing the Application Pools pane in the main view.在 Connections 窗格中,select Application Pools 节点,在主视图中显示 Application Pools 窗格。
  3. Click Advanced Settings…单击高级设置...
  4. Locate the Start Mode option under the General group and set it to AlwaysRunning.在 General 组下找到 Start Mode 选项并将其设置为 AlwaysRunning。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在没有iis或visual studio的情况下运行MVC 5网站 - Running MVC 5 website without iis or visual studio 网站适用于 Visual Studio 2017 但不适用于 IIS 10 - Website works on visual studio 2017 but not IIS 10 从visual studio 2008调试时,加载iis网站的速度太慢了 - loading of iis website too slow while debugging from visual studio 2008 从Visual Studio 2012将非MVC网站部署到IIS7(Windows 2008)服务器 - Deploying non-MVC website to IIS7 (Windows 2008) server from Visual Studio 2012 如何在Visual Studio 2012中重命名IIS Express网站 - How to rename an IIS Express website in Visual Studio 2012 Visual Studio:将网站发布到远程IIS并同时推送到GIT - Visual Studio: Publish a website to remote IIS and Push to GIT simultaneously 将网站导入visual studio - Importing a website into visual studio 将网站从Visual Studio部署到Web服务器 - Deploy a website from Visual Studio to webserver Visual Studio将我的本地IIS网站配置为ASP.NET网站 - Visual Studio configures my local IIS website as an ASP.NET website Windows Server 2012上的IIS服务器无法打开网站 - IIS server on Windows Server 2012 not opening a website
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM