Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors after updating packages #58990

Open
1 task done
loganmj opened this issue Nov 15, 2024 · 2 comments · May be fixed by #58995
Open
1 task done

Errors after updating packages #58990

loganmj opened this issue Nov 15, 2024 · 2 comments · May be fixed by #58995
Assignees
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Comments

@loganmj
Copy link

loganmj commented Nov 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

After updating package Microsoft.AspNetCore.SpaProxy from version 8.0.11 to version 9.0.0, I experience the following runtime error:

Microsoft.AspNetCore.Hosting.Diagnostics[11]
Hosting startup assembly exception
System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.SpaProxy failed to execute. See the inner exception for more details.
---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.SpaProxy, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Microsoft.AspNetCore.SpaProxy, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.ExecuteHostingStartups()

I am running an ASP.NET project that targets framework version .NET 8.0. I verified that the project runs without error using Microsoft.AspNetCore.SpaProxy version 8.0.11. If it matters, I am using the MySql.EntityFrameworkCore package version 8.0.8 to interact with a MySQL database using EntityFramework.

I also had to rollback the following packages to version 8.0.11 for similar reasons:

  • Microsoft.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.Tools

When all three of these packages are rolled back, the code works again without issue.

Expected Behavior

I am running a simple API application that connects to a MySQL database. When I run/debug the application, I expect the server app to compile, and run. And I expect my front end application to be able to interact with the API to retrieve data from my database.

When the application runs, I instead get feedback from the console that the Microsoft.AspNetCore.SpaProxy dll failed to execute, and my server code will not run.

Steps To Reproduce

I am working with the following project in my Github profile: https://github.com/loganmj/WorldCities

In this project, you will see that if you run the project as-is, it should startup correctly, but if you upgrade to Microsoft.AspNetCore.SpaProxy version 9.0.0, the server code fails to run, with the error as I have desribed.

Exceptions (if any)

No response

.NET Version

9.0.100

Anything else?

Output of dotnet --info:

.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.3068a692
MSBuild version: 17.12.7+5b8665660

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100\

.NET workloads installed:
[android]
Installation Source: VS 17.11.35431.28
Manifest Version: 35.0.0-rc.2.152/9.0.100-rc.2
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.android\35.0.0-rc.2.152\WorkloadManifest.json
Install Type: Msi

[maccatalyst]
Installation Source: VS 17.11.35431.28
Manifest Version: 18.0.9600-net9-rc2/9.0.100-rc.2
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.maccatalyst\18.0.9600-net9-rc2\WorkloadManifest.json
Install Type: Msi

[ios]
Installation Source: VS 17.11.35431.28
Manifest Version: 18.0.9600-net9-rc2/9.0.100-rc.2
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.ios\18.0.9600-net9-rc2\WorkloadManifest.json
Install Type: Msi

[maui-windows]
Installation Source: VS 17.11.35431.28
Manifest Version: 9.0.0-rc.2.24503.2/9.0.100-rc.2
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.maui\9.0.0-rc.2.24503.2\WorkloadManifest.json
Install Type: Msi

[aspire]
Installation Source: VS 17.11.35431.28
Manifest Version: 8.2.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
Install Type: Msi

Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4

.NET SDKs installed:
8.0.110 [C:\Program Files\dotnet\sdk]
8.0.206 [C:\Program Files\dotnet\sdk]
8.0.403 [C:\Program Files\dotnet\sdk]
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Nov 15, 2024
@BrennanConroy
Copy link
Member

BrennanConroy commented Nov 15, 2024

That's seems odd, you shouldn't even be able to build your application when targeting net8.0 and referencing 9.0 of Microsoft.AspNetCore.SpaProxy.

The Microsoft.AspNetCore.SpaProxy package only supports the net9.0 TFM. See https://www.nuget.org/packages/Microsoft.AspNetCore.SpaProxy#supportedframeworks-body-tab

Edit: Can repro, and it doesn't repro with other similar packages.

@wtgodbe wtgodbe linked a pull request Nov 15, 2024 that will close this issue
@wtgodbe
Copy link
Member

wtgodbe commented Nov 15, 2024

Thanks for reporting this, looks like an instance of NuGet/Home#6932. #58995 should fix the underlying issue for 10.0 and beyond - for your particular project, 9.0.0 packages aren't compatible w/ the net8.0 TFM. You either need to update to net9.0 and update all your PackageReferences to 9.0.0, or stay on net8.0 and only use 8.0.* packages.

@wtgodbe wtgodbe self-assigned this Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants