Visual Studio regularly freezes running Microsoft.VisualStudio.Web.Host.exe

无人久伴 提交于 2019-11-30 04:52:53

I noticed that the problem happened less often when I suspended ReSharper.

The problem still happened occasionally when editing classes under App_Code, but restarting Visual Studio worked around it.

sdg

I was facing a similar problem. A single Web application project with dozens of class libraries, migrated over from VS 2010 into VS 2013.

I was able to solve my problem by disabling the "Hosting Process" option:

To disable the hosting process

  1. Open an executable project in Visual Studio. Projects that do not
    produce executables (for example, class library or service projects) do not have this option.
  2. On the Project menu, click Properties.
  3. Click the Debug tab.
  4. Clear the Enable the Visual Studio hosting process check box.

Full details on MSDN: http://msdn.microsoft.com/en-us/library/ms185330.aspx

Another option for people experiencing this on old web applications that don't have the properties page in the accepted answer above.

Disable "Allow this precompiled site to be updatable".

  1. Open Site/Solution
  2. Right click and view Property Pages
  3. Go to MSBuild Options
  4. Uncheck "Allow this precompiled site to be updatable"

This worked for me.

They symptoms in the question of this post sound exactly like the nightmares I just had today:

Other actions that sometimes seem to trigger the problem:

"Go to definition"

Opening a file

Previewing a file

Closing a file

Using a refactoring "Find usages"

Plus intellisense wasn't working (even with CTRL + J) and 'Peek definition' was hanging as well.

I had to keep task killing visual studio (both 2015 and 2017).

My fix was to go into the project that I was having problems with, open the 'Package Manager Console' and uninstall and re-install the 'DotNetCompilerPlatform'

uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform 

and then

install-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform

So far every problem I was encountering has not resurfaced (but this was just today so still need to give it time).

UPDATE:

It started creeping back again. I noticed also that whomever had installed to the solution had only done it to two of the various projects. Uninstalling the compiler platform (which means using the compilers that came with Visual Studio) has made life sane again.

This problem stopped happening when the Web Site project was converted into a Web Application project.

Not an easy solution, but it did stop the problem.

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