Upgrade the app to .NET 10 and confirm compilation#218
Conversation
|
@copilot complete tasks |
… fix obsolete API Co-authored-by: AlexHedley <1573469+AlexHedley@users.noreply.github.com>
Completed in commit a7420db. Here's a summary of all changes made:
Build succeeds with 0 errors; 19/21 tests pass (2 pre-existing Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Update the app see following: Microsoft.AspNetCore.Components.WebAssembly 10.0.5 and Microsoft.CodeAnalysis.CSharp.Scripting 5.3.0 (Roslyn); sets false (required so assemblies are published as plain PE .dll files readable by MetadataReference.CreateFromImage) and false (preserves Roslyn reflection paths) Key implementation notes for running Roslyn inside WASM: Assembly.Location is always empty in a WASM host, so CSharpScript.RunAsync (which internally calls MetadataReference.CreateFromAssemblyInternal) throws a NotSupportedException. The app uses CSharpCompilation.CreateScriptCompilation with explicit MetadataReference.CreateFromImage(bytes) objects instead. |
…teScriptCompilation, CoreAssembly, async invoker Co-authored-by: AlexHedley <1573469+AlexHedley@users.noreply.github.com>
Implemented in commit 59b01dc. Here's a summary of all changes made:
Build: 0 errors. Tests: 19/21 pass (2 pre-existing |
Upgrades BlazorInteractive from .NET 7.0 to .NET 10.
Changes Made
global.json: Updated SDK version from7.0.408to10.0.102.csprojfiles: UpdatedTargetFrameworkfromnet7.0tonet10.0Microsoft.AspNetCore.Components.WebAssembly+ DevServer:7.0.20→10.0.5Microsoft.Extensions.Http:7.0.13→10.0.5Microsoft.Extensions.Logging/.Abstractions:8.0.x→10.0.5Microsoft.CodeAnalysis.CSharp:4.14.0→5.3.0Microsoft.CodeAnalysis.CSharp.Scripting: added at5.3.0NuGet.Protocol:6.14.0→7.3.0BlazorMonaco:3.3.0→3.4.0Microsoft.Web.LibraryManager.Build(Monaco editor is already served via_content/BlazorMonaco/inindex.html)BlazorInteractive.csproj: Added<WasmEnableWebcil>false</WasmEnableWebcil>so assemblies are published as plain PE.dllfiles (required forMetadataReference.CreateFromImage);<PublishTrimmed>false</PublishTrimmed>retained to preserve Roslyn reflection pathsEditorComponent.razor: FixedCS0618warning — updated obsoleteGlobal.SetTheme(string)to injectIJSRuntimeand use theGlobal.SetTheme(JSRuntime, theme)overloadBootstrapResources.cs: AddedCoreAssemblydictionary property — in .NET 10,System.Private.CoreLibmoved to a separatecoreAssemblycategory in the manifestBootstrapInfo.cs:Assemblies()now merges bothAssemblyandCoreAssemblycategories; without both, Roslyn throws "Predefined type 'System.Object' is not defined"BlazorReferenceFilter.cs: Updated to handle the .NET 10 format — the assembly manifest is now embedded in_framework/dotnet.jsbetween/*json-start*/and/*json-end*/markers; falls back to_framework/blazor.boot.jsonfor .NET 8 backward-compatibilityCSharpCompilationBuilder.cs: Switched fromCSharpCompilation.CreatetoCreateScriptCompilation—Assembly.Locationis always empty in a WASM host, so explicitMetadataReference.CreateFromImage(bytes)objects are used insteadCSharpCompiler.cs: Parses user source withSourceCodeKind.Scriptto match script compilation modeIAssemblyInvoker.cs+AssemblyInvoker.cs: Changed toTask<string?> InvokeAsync(Assembly)— locates the Roslyn-generated<Factory>entry point onSubmission#0via reflection and awaits it;Console.SetOutredirects output to the panelIndex.razor: Removed the class/namespace wrapper (script compilation handles top-level statements directly); updated invocation toawait AssemblyInvoker.InvokeAsyncTesting
dotnet buildsucceeds with 0 errorsNuGetPackageGetterfailures — issue NuGet Packages #19,NotImplementedException)Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.