[dotnet-sdk-10.0.100-preview.5.25272.110] Fail to launch Blazor-Blogs App with System.InvalidOperationException after retargeting #62171
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: By Design
Resolved because the behavior in this issue is the intended design.
Status: Resolved
Is there an existing issue for this?
Describe the bug
When retargeting the 3rd party applications to .NET10 with dotnet-sdk-10.0.100-preview.5.25272.110, it will throw below errors when running the app:
Application Name: Blazor-Blogs
OS: Windows 10 22H2
CPU: X64
.NET Build Number: dotnet-sdk-10.0.100-preview.5.25272.110
App, App Source Location & Repro machine checking at:
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2494440
Github Link:
https://github.com/ADefWebserver/Blazor-Blogs
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.300:+default 9.0:Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.5.25272.110+ default 9.0: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.4.25258.110+ retarget10.0: Fail
4). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.5.25272.110+ retarget10.0: Fail
5). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.5.25277.114+ retarget10.0: Fail
Expected Behavior
The page opened successfully without any errors
Steps To Reproduce
Minimal Repro steps (Demo attached: BlazorAppDemo):
The machine has dotnet-sdk-10.0.100-preview.5.252722.110 installed.
Create a default 9.0 blazor web project.
Right click on Solution>Properties, Retarget framework selection 10.0.
Add file to the root directory: IdentityRedirectManager. cs
Register Service in Program.cs
builder.Services.AddScoped<IdentityRedirectManager>();
Remove the judgment of whether it is a development environment in Program.cs:
Modify Components/Pages/Home.razor page
Publish app.
Cd \bin\release\net10.0\publish
Launch "BlazorAppDemo.exe"
Open the website: http://localhost:5000/.
Exceptions (if any)
Actual Result: Open failed with below error.
.NET Version
10.0.100-preview.5.25272.110
Anything else?
App Repro steps:
Please check the repro machine from devdiv bug
The machine has dotnet-sdk-10.0.100-preview.5.252722.110 installed.
1.Update the "C:\Users\test01\Desktop\App\Blazor-Blogs\BlazorBlogs.runtimeconfig.json" to run against with .NET 10:
Launch application from "C:\Users\test01\Desktop\App\Blazor-Blogs\BlazorBlogs.exe".
Open the website: http://localhost:5000/.
Input "appcompat@163.com" in Email.
Get password from "C:\Users\test01\Desktop\Password.txt" , then input into the password.
Click Login.
Expected Result: log in successfully.
Actual Result: log in failed with below error.
Dotnet Info:
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: