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

Method not found Exception when Microsoft.FluentUI.AspNetCore.Components 4.0.0 is referenced #948

Closed
ProH4Ck opened this issue Nov 18, 2023 · 6 comments

Comments

@ProH4Ck
Copy link

ProH4Ck commented Nov 18, 2023

image

Problem description

When a project referenced by AppHost references Microsoft.FluentUI.AspNetCore.Components version 4.0.0 startup breaks with the following exception:

Method not found: 'Void Microsoft.FluentUI.AspNetCore.Components.LibraryConfiguration.set_HostingModel(Microsoft.FluentUI.AspNetCore.Components.BlazorHostingModel)'.

   at Aspire.Dashboard.DashboardWebApplication.<>c.<.ctor>b__7_2(LibraryConfiguration options)
   at Microsoft.FluentUI.AspNetCore.Components.ServiceCollectionExtensions.AddFluentUIComponents(IServiceCollection services, Action`1 configuration)
   at Aspire.Dashboard.DashboardWebApplication..ctor(ILogger`1 logger, Action`1 configureServices)
   at Aspire.Hosting.Dcp.DcpHostService..ctor(DistributedApplicationModel applicationModel, DistributedApplicationOptions options, ILoggerFactory loggerFactory, IOptions`1 dcpOptions, IOptions`1 publishingOptions, ApplicationExecutor appExecutor, Locations locations, KubernetesService kubernetesService)
   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 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.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.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 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>d__15.MoveNext()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   at Aspire.Hosting.DistributedApplication.<RunAsync>d__13.MoveNext()

Repro steps

  • Create a new project using the starter template
  • Add to Web project a reference to Microsoft.FluentUI.AspNetCore.Components v. 4.0.0
  • Run AppHost
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 18, 2023
@ProH4Ck
Copy link
Author

ProH4Ck commented Nov 18, 2023

Found a workaround: this is fixed in preview.2.
Add NuGet feed to https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json and update Aspire.Hosting package to version 8.0.0-preview.2.23567.5:

image

@ProH4Ck ProH4Ck closed this as completed Nov 18, 2023
@davidfowl davidfowl reopened this Nov 18, 2023
@davidfowl
Copy link
Member

This is a bug as the version you use shouldn't affect the dashboard. This is currently an issue with how we use project references.

@davidfowl davidfowl added area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 18, 2023
@efonsecab
Copy link

I just got this error while I was trying to convert some of my demo projects to FluentUI.
I tried to use a similar trick to other issue by forcing excluding assets, though it did not work for this specific case.

@iskandersierra
Copy link

Found a workaround: this is fixed in preview.2.
Add NuGet feed to https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json and update Aspire.Hosting package to version 8.0.0-preview.2.23567.5:

I can confirm this workaround work for me! Googling this issue only resulted in two answers, and this issue was not one of them. It should be! Thanks @ProH4Ck.

@leslierichardson95
Copy link

This will be fixed when decoupling the dashboard is completed.

@mitchdenny mitchdenny removed the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jan 10, 2024
@JamesNK
Copy link
Member

JamesNK commented Mar 7, 2024

This should be fixed because the dashboard is decoupled.

Comment if this is still a problem and we'll reopen and take another look.

@JamesNK JamesNK closed this as completed Mar 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants