I have a WPF application running in debug mode, and I would like to change the XAML while the application is still running.
我有一个运行在调试模式下的WPF应用程序,我想在应用程序仍在运行时更改XAML。
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.
我不是要求编辑和继续。我不介意必须重新启动应用程序才能使更改变得有效。我只是希望能够在应用程序仍在运行时对XAML文件进行更改,而不是必须(1)记住在UI中要更改的内容,(2)关闭应用程序,(3)回忆要更改的内容并进行更改。
4 个解决方案
#1
6
Menu => Debug => Detach All
菜单=> Debug => Detach All
#2
5
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.
右键单击解决方案资源管理器中的XAML文件,选择Open With…然后,选择源代码(文本)编辑器,然后单击“设置为默认”。然后,您可以在应用程序运行时编辑XAML文件,而无需分离。在此工作之前,您需要重新打开任何XAML文件。在VS2012进行测试。
#3
2
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)
顺便说一下,我可以在VS2017 XAML中进行更改,大多数更改甚至更新UI live(合并的RDs似乎不工作)。我不记得我是否必须禁用编辑和继续(这是我回到第一次出现时的默认步骤,因为我从来没有运气让它像我预期的那样工作)。我将回到2015年尝试它,但它不允许我这么做(IIRC 2015和2013年可能是唯一一个完全锁定XAML的)
#4
1
Just run it without the debugger attached in the first place.
只要运行它,不需要首先附加调试器。
Debug->Start without debugging...
没有调试调试- >开始……
or Ctrl+F5 (the default key shortcut)
或者Ctrl+F5(默认快捷键)
#1
6
Menu => Debug => Detach All
菜单=> Debug => Detach All
#2
5
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.
右键单击解决方案资源管理器中的XAML文件,选择Open With…然后,选择源代码(文本)编辑器,然后单击“设置为默认”。然后,您可以在应用程序运行时编辑XAML文件,而无需分离。在此工作之前,您需要重新打开任何XAML文件。在VS2012进行测试。
#3
2
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)
顺便说一下,我可以在VS2017 XAML中进行更改,大多数更改甚至更新UI live(合并的RDs似乎不工作)。我不记得我是否必须禁用编辑和继续(这是我回到第一次出现时的默认步骤,因为我从来没有运气让它像我预期的那样工作)。我将回到2015年尝试它,但它不允许我这么做(IIRC 2015和2013年可能是唯一一个完全锁定XAML的)
#4
1
Just run it without the debugger attached in the first place.
只要运行它,不需要首先附加调试器。
Debug->Start without debugging...
没有调试调试- >开始……
or Ctrl+F5 (the default key shortcut)
或者Ctrl+F5(默认快捷键)