dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 678 forks source link

Xaml Hot Reload support #5034

Open cSohaib opened 2 years ago

cSohaib commented 2 years ago

Issue Description

I'm a WPF developer, I use pure MVVM architecture so I only use objects and DataTemplates, So I don't need the designer and drag&drop features of WPF. I only use XAML code and I use hot reload feature in Visual Studio while debugging to see the changes I make in the UI. I'm a fan of VSCode and I use it for back-end development. I tried to load WPF project in VSCode (since I only need the code editor), and it worked perfectly, the syntax highlighting and suggestion is awesome, but unfortunately when I run debugging I can't see changes that I make immediately in the UI, I need to restart the application to see my changes. I don't know if Hot Reloading is supported, If it's supported how to enable it? And if it is not supported this would be a feature request.

N.B. I already tried Watch feature but it's not what I'm looking for, "Watch" restart the whole application after every change in code, I just need to refresh the UI without restart.

And thank you all for your great job

Steps to Reproduce

Open WPF project -> Run Start Debugging -> Change XAML code & save.

Expected Behavior

In Visual Studio Community you can change XAML code while debugging WPF application, and see your changes immediately in the UI.

Actual Behavior

In VSCode when I make changes in XAML while debugging, nothing changes in the UI so I need to restart my WPF application to see my changes

Logs

Environment information

VSCode version: 1.62.3 C# Extension: 1.24.0

Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.101 Commit: ef49f6213a Runtime Environment: OS Name: Windows OS Version: 10.0.19043 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.101\ Host (useful for support): Version: 6.0.1 Commit: 3a25a7f1cc .NET SDKs installed: 3.1.416 [C:\Program Files\dotnet\sdk] 5.0.303 [C:\Program Files\dotnet\sdk] 5.0.400 [C:\Program Files\dotnet\sdk] 5.0.404 [C:\Program Files\dotnet\sdk] 6.0.101 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |cpptools|ms-vscode|1.7.1| |csharp|ms-dotnettools|1.24.0| |js-jsx-snippets|skyran|11.0.0| |keyoti-changeallendoflinesequence|vs-publisher-1448185|0.0.3| |vscode-sql-formatter|adpyke|1.4.4| |vscode-xml-complete|rogalmic|0.3.0| |xml|DotJoshJohnson|2.5.1|;
gregg-miskelly commented 2 years ago

I am leaving this issue open to help gauge the community's interest in this.

That said, I want to make sure expectations are calibrated: this would be a lot of work and will definitely not happen anytime soon. Visual Studio will always offer better XAML experiences than VS Code.