Visual Studio: Edit XAML file while debugging

随声附和 提交于 2020-01-01 23:54:41

问题


I have a WPF application running in debug mode, and I would like to change the XAML while the application is still running.

I'm not asking for Edit-and-Continue. I don't mind that I will have to restart the application for the changes to become effective. I just want to be able to make changes to the XAML file while the application is still running, rather than having to (1) remember what I want to change in the UI, (2) close the application, (3) recall what I want to change and make the change.


回答1:


Menu => Debug => Detach All




回答2:


Right-click the XAML file in Solution Explorer and select Open With..., then choose Source Code (Text) Editor and click Set as Default. You can then edit XAML files while the app is running, without detaching. You'll need to reopen any XAML files before this works. Tested in VS2012.




回答3:


FYI, I'm able to make changes in VS2017 XAML, and most changes even update the UI live (merged RDs don't seem to work). I can't remember if I had to disable Edit and Continue (been a default step of mine going back to its first appearance, since I've never had luck getting it working like I expect it to). I'm going back in 2015 trying it, and it's not letting me do it (IIRC 2015 and maybe 2013 were the only ones to totally lock the XAML)




回答4:


Just run it without the debugger attached in the first place.

Debug->Start without debugging...

or Ctrl+F5 (the default key shortcut)



来源:https://stackoverflow.com/questions/3336213/visual-studio-edit-xaml-file-while-debugging

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