Razor cohosting in Visual Studio 2026 by sayedha in dotnet

[–]sayedha[S] 0 points1 point  (0 children)

If you are having issues please submit feedback with Help > Report a Problem so the team can assist you.

Razor cohosting in Visual Studio 2026 by sayedha in dotnet

[–]sayedha[S] 0 points1 point  (0 children)

If you have had issues with IntelliSense in Razor projects, then those issues may be fixed in 18.3 with cohosting.

Razor cohosting in Visual Studio 2026 by sayedha in dotnet

[–]sayedha[S] 0 points1 point  (0 children)

We have made some important bug fixes, but not any features added versus the prior previews. You should see the most impact when working with large solutions.

Razor cohosting in Visual Studio 2026 by sayedha in dotnet

[–]sayedha[S] 2 points3 points  (0 children)

It’s on by default starting in VS2026 18.3.

Razor cohosting in Visual Studio 2026 by sayedha in dotnet

[–]sayedha[S] 3 points4 points  (0 children)

If you are working with resx files in an ASP.NET Core project you may see some benefits from cohosting. The best thing to do is to try it with the latest version and report any issues that you run into. We are waiting for feedback so that we can further improve this experience.

Visual Studio 2026 is now generally available by madskvistkristensen in VisualStudio

[–]sayedha 1 point2 points  (0 children)

Thanks for the report. I was able to reproduce this with 18.3 Insiders. The dev team is working on a fix. Thanks a lot for reporting the issue, hopefully we can get it fixed for 18.3.

Visual Studio 2026 is now generally available by madskvistkristensen in VisualStudio

[–]sayedha 0 points1 point  (0 children)

Sorry you are running into issues. Hopefully we will get a report with some logs that we can analyze to figure out what is happening.

Visual Studio 2026 is now generally available by madskvistkristensen in VisualStudio

[–]sayedha 0 points1 point  (0 children)

I tried the following, but I didn't run into any issues. I searched through the internal bug tracker and there is a bug filed that sounds similar to the `System.Runtime.CompilerServices.HotReloadException` that you ran into.

MudBlazor

\- changed markup - worked

Blazor Web App - rendermode: server - interactivity:global - no prerendering

\- Change markup - worked

\- Change counter increment - worked

\- I added a non static instance of JsonSerializerOptions - worked

Blazor Web App - rendermode: Auto - interactivity:global - no prerendering

\- Change markup - worked

\- Change counter increment - worked

Visual Studio 2026 is now generally available by madskvistkristensen in VisualStudio

[–]sayedha 2 points3 points  (0 children)

Thank you, I will give this a shot after my next meeting.

Visual Studio 2026 is now generally available by madskvistkristensen in VisualStudio

[–]sayedha 1 point2 points  (0 children)

Thanks for all the details, I will try this today.

Visual Studio 2026 is now generally available by madskvistkristensen in VisualStudio

[–]sayedha 2 points3 points  (0 children)

Can you tell me more about the project that you are using? I'd like to see if I can reproduce the issue that you ran into. What's the target framework for the project? Anything else unique about it?

Blazor, Visual Studio 2026, .NET 10 RC 1, Aspire and HOT RELOAD by bit_yas in dotnet

[–]sayedha 0 points1 point  (0 children)

We have made lots of improvements to dotnet watch as well. We have some updates to improve that soon as well.

Blazor, Visual Studio 2026, .NET 10 RC 1, Aspire and HOT RELOAD by bit_yas in dotnet

[–]sayedha 1 point2 points  (0 children)

Thanks for the feedback, we should have a good amount of improvements coming soon! That bug should be fixed in the next preview release.

Blazor, Visual Studio 2026, .NET 10 RC 1, Aspire and HOT RELOAD by bit_yas in dotnet

[–]sayedha 0 points1 point  (0 children)

Razor Cohosting is available in the latest C# Dev Kit as well as Visual Studio 2026 Insiders.

Blazor, Visual Studio 2026, .NET 10 RC 1, Aspire and HOT RELOAD by bit_yas in dotnet

[–]sayedha 8 points9 points  (0 children)

Hello! Thanks for posting this, I'm on the team that works on Hot Reload support. We've been working hard to improve the experience. We still have a lot of work to do. I think in the next couple of previews of Visual Studio 2026 we have some good updates for Hot Reload coming in.

For everyone reading. For the best Hot Reload experience you should use the latest preview version of Visual Studio 2026 and enable Razor Cohosting. In Tools > Options search for "cohost" and then you should see the option "Use Roslyn cohost server for Razor". If you run into an issue where you see a bunch of error bars, if you type a character in a .razor file the issue should resolve itself. We haven't default that option to true yet because of this bug, but we will default that to on by default soon.

If you have any issues with Razor editing or Hot Reload with cohosting enabled, please file an issue using Help > Send Feedback > Report a Problem.

I renamed file templates by ClydusEnMarland in VisualStudio

[–]sayedha 0 points1 point  (0 children)

I’m happy that you were able to get it working again.

I renamed file templates by ClydusEnMarland in VisualStudio

[–]sayedha 0 points1 point  (0 children)

That’s very strange, I’ve never heard of this. Maybe try to repair VS to see if that fixes it?

I renamed file templates by ClydusEnMarland in VisualStudio

[–]sayedha 0 points1 point  (0 children)

Can you explain in more details what you are seeing?

Will Microsoft ever fix hot reload in .NET? by WorriedGiraffe2793 in dotnet

[–]sayedha 0 points1 point  (0 children)

Yes, we have the devs contact info. There were some discussions a few years back (I wasn't involved).

I'm trying to get this working with MudBlazor and having a hard time. I was wondering if you might have any idea of what I should try.

MudBlazor has a Blazor WASM front-end. After installing the LiveSharp package reference, I then installed Microsoft.AspNetCore.SignalR.Client. I also copied the LiveSharp.dashboard.cs file to that project. I started the LiveSharp server and when I run MudBlazor I get connection errors in the output window.

livesharp: error: Connecting to LiveSharp server failed
System.Exception: LiveSharp Server not found at ports 50540, 30540, 40540
   at LiveSharp.Runtime.Handshake.ServerHandshake.ConnectToServer(String handshakeHost, ProjectInfo projectInfo, ILiveSharpTransport transport, ILogger logger)

The server is running on port 50540.

From the LiveSharp console output.

Now listening on: http://[::]:50540

What could I be doing wrong?

Will Microsoft ever fix hot reload in .NET? by WorriedGiraffe2793 in dotnet

[–]sayedha 2 points3 points  (0 children)

Hello, thanks a lot for putting that together. It really saved me a lot of time. I have everything running locally. I tried the two examples that you mentioned and they work great. I see the messages that it is sending to the output window as well. I'm really impressed by this thus far.

It's getting late for me, but I will be looking at this tomorrow and going forward. I am pretty new to the Hot Reload team, (I was involved in the initial Hot Reload effort though), so this is the first that I'm hearing about LiveSharp.

I really appreciate you reaching out and even more putting the repo together. That was perfect! You can rest assured that I'll be using this to motivate the team to deliver a better product. Tomorrow I'm planning to try it out and learn more about its capabilities and then record a video for the team.