Closed Toudahl closed 8 months ago
That's the same underlying issue as https://github.com/dotnet/aspnetcore/issues/52152 (and unfortunately I didn't have enough time to create a proposal for an API in dotnet/runtime)
Ah, you are quite right. Looks like I should have searched harder before creating my issue.
@captainsafia i am not sure I agree this is a duplicate.
These are two different problems. This is about an exception one place that occurs because application name is used as assembly name.
The other issue is about secrets not working because application name is used as assembly name, at an other location.
Fixing one will not fix the other.
@captainsafia , @gfoidl , please have a closer look at the problem @Toudahl is complaining.
Here is the problematic part in Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions
The fact that the value is set by default to the entry-point assembly name, doesn't allow to treat the ApplicationName
as assembly name and try loading it !!!
This is breaking change that is not even documented.
Also, even though the manager
instance could be provided via DI
, the PopulateDefaultParts
method is internal !!! and not marked as override
- I hardly understand the reason behind letting user to injects their own implementation if he can't provide his own implementation of PopulateDefaultParts
method.
Please reopen and provide estimations for the fix. Thanks
Is there an existing issue for this?
Describe the bug
When using CreateBuilder overload that takes a
WebApplicaitonOptions
, and setting theApplicationName
property aFileNotFoundException
occurs in theGenericWebHostBuilder
on this lineThe value set on the
ApplicationName
makes it way to the output of theGetFinalHostingStartupAssemblies
method called above the Assembly.LoadExpected Behavior
No exception is thrown, and the custom application name becomes available through the
IWebHostEnvironment
interface/implementation.Steps To Reproduce
https://github.com/Toudahl/didactic-doodle/blob/main/WebApplication2/Program.cs
Exceptions (if any)
.NET Version
8.0.101
Anything else?
The issue occurs both using dotnet run and rider.