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] Update existing aspire 8.0 P1 project to 8.0 P3, F5 will encounter an error: "Inner Exception 1: DirectoryNotFoundException". #2012

Closed
v-reinawang opened this issue Jan 31, 2024 · 12 comments · Fixed by #2013
Assignees
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Comments

@v-reinawang
Copy link

REGRESSION INFO: Repro on Aspire 8.0.0-preview.2.23619.3

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.10.0 Preview 1.0 [34530.244.main]
  3. Install 8.0.200 RTM SDK
  4. Install Aspire Preview 3 latest build 8.0.0-preview.3.24080.1
  5. Apply NuGet Feeds

REPRO STEPS

  1. On Aspire template version 8.0.0-preview.1.23557.2, Open VS, create a new project > ASP.NET Core Web App (Razor Pages) > .NET 8.0 > check 'Enlist in .NET Aspire orchestration' > Create. Or you can open existing aspire 8.0 P1 project.
  2. Update Aspire template version to latest 8.0.0-preview.3.24078.5
  3. Open the project you just created, build solution and will encounter this bug [WebToolsE2E][Aspire] Open an existing aspire 8.0 P1 project and build the solution, there is an error: The type or namespace name 'Projects' could not be found (are you missing a using directive or an assembly reference?). #1944
  4. Update 'Aspire.Hosting' version to 8.0.0-preview.3.24080.1
  5. Build solution and F5

ACTUAL
F5 will encounter an error.
System.AggregateException
HResult=0x80131500
Message=One or more errors occurred. (C:\Users\v-reinawang.nuget\packages\microsoft.fluentui.aspnetcore.components\4.0.0-preview.2\staticwebassets)
Source=System.Private.CoreLib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Aspire.Hosting.DistributedApplication.Run()
at Program.

$(String[] args) in D:\Users\v-reinawang\Desktop\WebApplication1\WebApplication1.AppHost\Program.cs:line 5

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
DirectoryNotFoundException: C:\Users\v-reinawang.nuget\packages\microsoft.fluentui.aspnetcore.components\4.0.0-preview.2\staticwebassets\

image

EXPECTED
The project can run successfully.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jan 31, 2024
@davidfowl davidfowl added this to the preview 3 (Feb) milestone Jan 31, 2024
@davidfowl
Copy link
Member

davidfowl commented Jan 31, 2024

@v-reinawang can you put the entire stack trace in the issue? (make sure you click "Show External code")

@v-reinawang
Copy link
Author

@davidfowl This is the entire stack trace.

info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
Unhandled exception. System.AggregateException: One or more errors occurred. (C:\Users\v-reinawang.nuget\packages\microsoft.fluentui.aspnetcore.components\4.0.0-preview.2\staticwebassets)
---> System.IO.DirectoryNotFoundException: C:\Users\v-reinawang.nuget\packages\microsoft.fluentui.aspnetcore.components\4.0.0-preview.2\staticwebassets
at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.b__1_0(String contentRoot)
at Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func2 fileProviderFactory) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration) at Microsoft.AspNetCore.Hosting.BootstrapHostBuilder.RunDefaultCallbacks() at Microsoft.AspNetCore.Builder.WebApplicationBuilder.InitializeHosting(BootstrapHostBuilder bootstrapHostBuilder) at Microsoft.AspNetCore.Builder.WebApplicationBuilder..ctor(WebApplicationOptions options, Action1 configureDefaults)
at Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder()
at Aspire.Hosting.Dashboard.DashboardServiceHost..ctor(DistributedApplicationOptions options, DistributedApplicationModel applicationModel, KubernetesService kubernetesService, IEnvironmentVariables environmentVariables, IOptions1 publishingOptions, ILoggerFactory loggerFactory, IConfigureOptions1 loggerOptions) in //src/Aspire.Hosting/Dashboard/DashboardServiceHost.cs:line 69
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Aspire.Hosting.DistributedApplicationBuilder.<>c.<.ctor>b__14_1(IServiceProvider sp) in /
/src/Aspire.Hosting/DistributedApplicationBuilder.cs:line 67
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in //src/Aspire.Hosting/DistributedApplication.cs:line 132
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Aspire.Hosting.DistributedApplication.Run() in /
/src/Aspire.Hosting/DistributedApplication.cs:line 153
at Program.

$(String[] args) in D:\Users\v-reinawang\Desktop\WebApplication1\WebApplication1.AppHost\Program.cs:line 5

@davidfowl
Copy link
Member

Thanks, this is the same as #1923, but reproduced via an upgrade.

@davidfowl
Copy link
Member

Does the error go away when you do a clean rebuild?

@v-reinawang
Copy link
Author

Rebuild solution and F5, this issue also repro.

@davidfowl
Copy link
Member

delete, obj and bin, and rebuild, it should run.

@davidfowl davidfowl self-assigned this Jan 31, 2024
@v-reinawang
Copy link
Author

Should I delete these two folders directly? I tried removing them but still repro.
image

@davidfowl
Copy link
Member

The ones inside of the WebApplication1.AppHost

davidfowl added a commit that referenced this issue Jan 31, 2024
- We're exposing a simple gRPC endpoint for the dashboard to talk to. We can avoid loading static assets completely (which causes all kinds of problems when things get out of sync).

Fixes #2012
@v-reinawang
Copy link
Author

There is no obj and bin file in WebApplication1.AppHost.

@davidfowl
Copy link
Member

When you build the solution or run that project, it produces a binary in the bin folder, you should have both a bin and obj for each project.

@v-reinawang
Copy link
Author

After I deleted the obj and bin folders under WebApplication1.AppHost, rebuild and F5 can be successful.

davidfowl added a commit that referenced this issue Jan 31, 2024
- We're exposing a simple gRPC endpoint for the dashboard to talk to. We can avoid loading static assets completely (which causes all kinds of problems when things get out of sync).

Fixes #2012
github-actions bot pushed a commit that referenced this issue Jan 31, 2024
…a simple gRPC endpoint for the dashboard to talk to. We can avoid loading static assets completely (which causes all kinds of problems when things get out of sync).

Fixes #2012
davidfowl added a commit that referenced this issue Jan 31, 2024
…a simple gRPC endpoint for the dashboard to talk to. We can avoid loading static assets completely (which causes all kinds of problems when things get out of sync). (#2015)

Fixes #2012

Co-authored-by: David Fowler <[email protected]>
@v-reinawang
Copy link
Author

Verify that this issue has been fixed in 8.0.0-preview.3.24081.5

radical pushed a commit to radical/aspire that referenced this issue Feb 2, 2024
- We're exposing a simple gRPC endpoint for the dashboard to talk to. We can avoid loading static assets completely (which causes all kinds of problems when things get out of sync).

Fixes dotnet#2012
radical pushed a commit to radical/aspire that referenced this issue Feb 6, 2024
- We're exposing a simple gRPC endpoint for the dashboard to talk to. We can avoid loading static assets completely (which causes all kinds of problems when things get out of sync).

Fixes dotnet#2012
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants