I'm working on a new Blazor app, with server-side and WebAssembly projects in the VS solution. When I debug the app I get a, "Unhandled exception has occurred" message in the bottom of the page. Looking at my event viewer I see this, which suggests the problem is with the .NET Runtime:
Log Name: Application
Source: .NET Runtime
Date: 8/1/2025 9:51:35 AM
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MYPC.nmsg
Description:
Application: ServiceHub.Host.dotnet.x64.exe
CoreCLR Version: 8.0.1825.31117
.NET Version: 8.0.18
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.Cancel()
at Microsoft.VisualStudio.Conversations.Service.Mcp.McpConfigurationService.Dispose()
at Microsoft.VisualStudio.Conversations.Service.Mcp.McpManager.Dispose()
at Microsoft.ServiceHub.HostStub.ServiceManager.TryDisposeObjectAsync(Object obj, TraceSource logger, String objectName)
at Microsoft.ServiceHub.HostStub.ServiceManager.<>c__DisplayClass62_0.<<CreateDisposeServiceModuleTask>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1026</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2025-08-01T15:51:35.0794655Z" />
<EventRecordID>59915</EventRecordID>
<Correlation />
<Execution ProcessID="16496" ThreadID="0" />
<Channel>Application</Channel>
<Computer>MYPC.nmsg</Computer>
<Security />
</System>
<EventData>
<Data>Application: ServiceHub.Host.dotnet.x64.exe
CoreCLR Version: 8.0.1825.31117
.NET Version: 8.0.18
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.Cancel()
at Microsoft.VisualStudio.Conversations.Service.Mcp.McpConfigurationService.Dispose()
at Microsoft.VisualStudio.Conversations.Service.Mcp.McpManager.Dispose()
at Microsoft.ServiceHub.HostStub.ServiceManager.TryDisposeObjectAsync(Object obj, TraceSource logger, String objectName)
at Microsoft.ServiceHub.HostStub.ServiceManager.<>c__DisplayClass62_0.<<CreateDisposeServiceModuleTask>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
</Data>
</EventData>
</Event>
I don't understand what's going on and I certainly don't understand why it is referring to .NET Version 8.0.18, when I am using .NET 9. I need help or direction as to how to resolve this issue.