Visual Studio在XAML文件中的更改后挂起

时间:2022-11-06 20:21:12

I recently got into a strange problem, it seem to have happen randomly.

我最近遇到了一个奇怪的问题,它似乎是随机发生的。

When I make changes inside a XAML-file (It can be anything, change text in a button, change color of background etc.) my visual studio hangs when starting my program.

当我在XAML文件中进行更改(可以是任何内容,更改按钮中的文本,更改背景颜色等)时,我的visual studio会在启动程序时挂起。

Does anyone know how to fix this really annoying problem?

有谁知道如何解决这个真正烦人的问题?

6 个解决方案

#1


5  

I posted a thread about this on MSDN's forum too, and I got an answer which did the trick:

我也在MSDN的论坛上发布了一个关于此的帖子,我得到了一个答案,它可以解决这个问题:

Apparently I had to delete the Project Solution file and then run the .csproj file.

显然我不得不删除Project Solution文件,然后运行.csproj文件。

Don't really know why but this made it work again! So if anyone has been experiencing this problem, try the solution above.

不知道为什么,但这使它再次起作用!因此,如果有人遇到此问题,请尝试上面的解决方案。

EDIT:

编辑:

Link to the answer on MSDN

链接到MSDN上的答案

#2


1  

I've had the same problem and for me it was Resharper causing it. Try to suspend Resharper and uninstall all third-party add-ins if it doesn't help (resharper, ghostdoc etc.)

我遇到了同样的问题,对我而言,它是Resharper造成的。尝试暂停Resharper并卸载所有第三方加载项,如果它没有帮助(resharper,ghostdoc等)

Also try to run VS with /SafeMode flag and see if it works properly.

还尝试使用/ SafeMode标志运行VS,看看它是否正常工作。

#3


0  

Vote here :https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2204137-improve-the-xaml-designer-performance

在这里投票:https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2204137-improve-the-xaml-designer-performance

A tip from that page that helped in my case ...

该页面的提示对我的案例有所帮助......

Disabling effects rendering (the fx button at the bottom left of the xaml editor) caused a significant performance boost.

禁用效果渲染(xaml编辑器左下角的fx按钮)会显着提升性能。

Also, deleting the .suo file can sometimes fix a lot of Visual Studio problems. In VS2015 just delete the .vs folder at the root of the solution, that's where the .suo file lives.

此外,删除.suo文件有时可以解决许多Visual Studio问题。在VS2015中,只需删除解决方案根目录下的.vs文件夹,即.suo文件所在的位置。

#4


0  

In my case, I deleted all generated files along with .db and .opendb files and the xaml editing stopped to hang up.

就我而言,我删除了所有生成的文件以及.db和.opendb文件,并且xaml编辑停止了以挂起。

#5


0  

It is an older question, I know, but since others have similar issues in older and newer versions of Visual Studio, maybe the following workaround may help (tested on three PCs, VS 2017, Windows 10):

我知道这是一个较老的问题,但由于其他版本的Visual Studio在较旧版本和较新版本中存在类似问题,因此以下解决方法可能有所帮助(在三台PC上测试,VS 2017,Windows 10):

  1. Open a XAML project in Visual Studio
  2. 在Visual Studio中打开XAML项目
  3. Open Windows Task Manager
  4. 打开Windows任务管理器
  5. Search Microsoft Visual Studio XAML Designer (if it is not there, try opening a XAML file in VS)
  6. 搜索Microsoft Visual Studio XAML Designer(如果不存在,请尝试在VS中打开XAML文件)
  7. Right-click and choose Properties
  8. 右键单击并选择“属性”
  9. Select Compatibility tab
  10. 选择Compatibility选项卡
  11. Below Compatibility mode check Run this program in compatibility mode for:
  12. 在兼容模式下,选中在兼容模式下运行此程序:
  13. Select Windows 7
  14. 选择Windows 7

Screenshot

截图

I had no crashes/freezes since changing the compatibility settings.

自更改兼容性设置后,我没有崩溃/冻结。

Good luck!

祝你好运!

#6


0  

I experienced the same issue. VS2015 would either hang for about 40 seconds or crash sometimes when closing the XAML designer. After uninstalling the extension CodeMaid the issue was gone.

我遇到了同样的问题。关闭XAML设计器时,VS2015会挂起约40秒或有时会崩溃。卸载扩展CodeMaid后,问题就消失了。

#1


5  

I posted a thread about this on MSDN's forum too, and I got an answer which did the trick:

我也在MSDN的论坛上发布了一个关于此的帖子,我得到了一个答案,它可以解决这个问题:

Apparently I had to delete the Project Solution file and then run the .csproj file.

显然我不得不删除Project Solution文件,然后运行.csproj文件。

Don't really know why but this made it work again! So if anyone has been experiencing this problem, try the solution above.

不知道为什么,但这使它再次起作用!因此,如果有人遇到此问题,请尝试上面的解决方案。

EDIT:

编辑:

Link to the answer on MSDN

链接到MSDN上的答案

#2


1  

I've had the same problem and for me it was Resharper causing it. Try to suspend Resharper and uninstall all third-party add-ins if it doesn't help (resharper, ghostdoc etc.)

我遇到了同样的问题,对我而言,它是Resharper造成的。尝试暂停Resharper并卸载所有第三方加载项,如果它没有帮助(resharper,ghostdoc等)

Also try to run VS with /SafeMode flag and see if it works properly.

还尝试使用/ SafeMode标志运行VS,看看它是否正常工作。

#3


0  

Vote here :https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2204137-improve-the-xaml-designer-performance

在这里投票:https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2204137-improve-the-xaml-designer-performance

A tip from that page that helped in my case ...

该页面的提示对我的案例有所帮助......

Disabling effects rendering (the fx button at the bottom left of the xaml editor) caused a significant performance boost.

禁用效果渲染(xaml编辑器左下角的fx按钮)会显着提升性能。

Also, deleting the .suo file can sometimes fix a lot of Visual Studio problems. In VS2015 just delete the .vs folder at the root of the solution, that's where the .suo file lives.

此外,删除.suo文件有时可以解决许多Visual Studio问题。在VS2015中,只需删除解决方案根目录下的.vs文件夹,即.suo文件所在的位置。

#4


0  

In my case, I deleted all generated files along with .db and .opendb files and the xaml editing stopped to hang up.

就我而言,我删除了所有生成的文件以及.db和.opendb文件,并且xaml编辑停止了以挂起。

#5


0  

It is an older question, I know, but since others have similar issues in older and newer versions of Visual Studio, maybe the following workaround may help (tested on three PCs, VS 2017, Windows 10):

我知道这是一个较老的问题,但由于其他版本的Visual Studio在较旧版本和较新版本中存在类似问题,因此以下解决方法可能有所帮助(在三台PC上测试,VS 2017,Windows 10):

  1. Open a XAML project in Visual Studio
  2. 在Visual Studio中打开XAML项目
  3. Open Windows Task Manager
  4. 打开Windows任务管理器
  5. Search Microsoft Visual Studio XAML Designer (if it is not there, try opening a XAML file in VS)
  6. 搜索Microsoft Visual Studio XAML Designer(如果不存在,请尝试在VS中打开XAML文件)
  7. Right-click and choose Properties
  8. 右键单击并选择“属性”
  9. Select Compatibility tab
  10. 选择Compatibility选项卡
  11. Below Compatibility mode check Run this program in compatibility mode for:
  12. 在兼容模式下,选中在兼容模式下运行此程序:
  13. Select Windows 7
  14. 选择Windows 7

Screenshot

截图

I had no crashes/freezes since changing the compatibility settings.

自更改兼容性设置后,我没有崩溃/冻结。

Good luck!

祝你好运!

#6


0  

I experienced the same issue. VS2015 would either hang for about 40 seconds or crash sometimes when closing the XAML designer. After uninstalling the extension CodeMaid the issue was gone.

我遇到了同样的问题。关闭XAML设计器时,VS2015会挂起约40秒或有时会崩溃。卸载扩展CodeMaid后,问题就消失了。