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

[WebToolsE2E][Aspire] Updated Aspire version from 8.0.0 to 8.0.1. When running the project, an exception occurred: System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.ServiceDiscovery, Version=8.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.' #9489

Open
v-reinawang opened this issue Jun 19, 2024 · 9 comments
Assignees
Labels
Triage-Approved Reviewed and prioritized

Comments

@v-reinawang
Copy link

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.10.3
    • Web workload
    • Includes Aspire 8.0.0
  3. Install Aspire 8.0.1 workload

REPRO STEPS

  1. Open an existing 8.0.0 solutions (Aspire Starter Application), build and run - works
  2. Right click Solution > Manage NuGet Packages for Solution > Update
  3. Updated the versions of packages Aspire.Hosting.AppHost and Microsoft.Extensions.ServiceDiscovery to 8.0.1
  4. Right click the solution > Build and F5

NOTE:

  1. If you don't build and run in the first step, this issue will not be reproduced.
  2. I updated a project with 8.0.0-preview.7.24251.11 to 8.0.0, this issue is not reproduced.
  3. Execute all REPRO STEPS in CMD. This issue is not reproduced.
  4. After updating the package, wait for all packages to be restored and build successfully, then press F5, and you will encounter this issue. However, Rebuild solution will not encounter this issue.

ACTUAL
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'Microsoft.Extensions.ServiceDiscovery, Version=8.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Source=AspireApp1.ServiceDefaults
StackTrace:
at Microsoft.Extensions.Hosting.Extensions.AddServiceDefaults(IHostApplicationBuilder builder) in C:\Users\v-reinawang\Desktop\AspireApp1\AspireApp1\AspireApp1.ServiceDefaults\Extensions.cs:line 35
at Program.

$(String[] args) in C:\Users\v-reinawang\Desktop\AspireApp1\AspireApp1\AspireApp1.ApiService\Program.cs:line 4
image

EXPECTED
Can run successfully.

@drewnoakes
Copy link
Member

This might possibly be a symptom of #8014

@drewnoakes drewnoakes self-assigned this Jun 20, 2024
@smitpatel smitpatel added the Triage-Approved Reviewed and prioritized label Jun 27, 2024
@Rita003
Copy link

Rita003 commented Jul 4, 2024

This issue also repro when the Aspire version is upgraded from 8.0.2 to 8.1 and run the project.

@AndiRudi
Copy link

I just updated my Project from to 8.1.0 to 8.2.0 and now I have this error as well. I have 4 projects and when deployed to Azure all 4 throw those errors... Is there a workaround? )I tried cleaning the solution and then azd down and azd up but nothing fixes the errors)

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.ServiceDiscovery, Version=8.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Aspire.Npgsql.EntityFrameworkCore.PostgreSQL, Version=8.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

@v-reinawang
Copy link
Author

I tried to update the project from aspire 8.1.0 to aspire 8.2.0 (updating the versions of packages Aspire.Hosting.AppHost and Microsoft.Extensions.ServiceDiscovery from 8.1.0 to 8.2.0, and updating the version of Microsoft.Extensions.Http.Resilience from 8.7.0 to 8.8.0), and both running and publishing were successful.

@AndiRudi
Copy link

AndiRudi commented Sep 2, 2024

After removing all bin and obj folders and restoring and deploying again it's working again. Something was weird there, but for me its fine now

@v-reinawang
Copy link
Author

I tried to update the project from aspire 8.2.0 to aspire 9.0 (updated versions of Aspire.Hosting.AppHost and Microsoft.Extensions.ServiceDiscovery), this issue still repro.

@drewnoakes
Copy link
Member

@v-reinawang if you wait a minute after step 3 (so that automatic restore can complete) does the problem still repro for you? If so, then this is a dupe of #8014. If not, it's something else.

@v-reinawang
Copy link
Author

I tried to update the project from aspire 8.1.0 to aspire 8.2.0 (only updated versions of Aspire.Hosting.AppHost and Microsoft.Extensions.ServiceDiscovery), wait a few minutes and run, this issue still repro.

After updating the two packages mentioned above, update Microsoft.Extensions.Http.Resilience, and then press F5 to run the project, will not encounter this issue.

After updating the two packages mentioned above, click 'Rebuild solution' and run will not encounter this issue.

@v-reinawang
Copy link
Author

This issue also repro when the Aspire version is upgraded from 8.2.2 to 9.0.0 and run the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage-Approved Reviewed and prioritized
Projects
None yet
Development

No branches or pull requests

5 participants