-
-
Notifications
You must be signed in to change notification settings - Fork 499
Open
Labels
bugIssues describing a bug or pull requests fixing a bug.Issues describing a bug or pull requests fixing a bug.
Description
Describe the bug
dotnet/aspnetcore#45022 (comment)
I updated one of my projects to .NET 7 and started getting the following error:
Message:
System.IO.FileNotFoundException : Could not load file or assembly 'My Awesome App, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
Stack Trace:
RuntimeAssembly.<InternalLoad>g____PInvoke|47_0(NativeAssemblyNameParts* pAssemblyNameParts, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Int32 throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
Assembly.Load(AssemblyName assemblyRef)
ApplicationPartManager.GetApplicationPartAssemblies(String entryAssemblyName)
ApplicationPartManager.PopulateDefaultParts(String entryAssemblyName)
MvcCoreServiceCollectionExtensions.GetApplicationPartManager(IServiceCollection services, IWebHostEnvironment environment)
MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection services)
IServiceCollectionExtensions.AddApiExplorerServices(IServiceCollection services)
IServiceCollectionExtensions.AddVersionedApiExplorer(IServiceCollection services)
Startup.ConfigureServices(IServiceCollection services) line 38
<7 more frames...>
WebApplicationFactory`1.CreateHost(IHostBuilder builder)
WebApplicationFactory`1.ConfigureHostBuilder(IHostBuilder hostBuilder)
WebApplicationFactory`1.EnsureServer()
WebApplicationFactory`1.CreateDefaultClient(DelegatingHandler[] handlers)
WebApplicationFactory`1.CreateDefaultClient(Uri baseAddress, DelegatingHandler[] handlers)
WebApplicationFactory`1.CreateClient(WebApplicationFactoryClientOptions options)
WebApplicationFactory`1.CreateClient()
MyCoolAppControllerTest.ctor(ITestOutputHelper testOutputHelper) line 22
InvokeStub_MyCoolAppControllerTest.ctor(Object, Object, IntPtr*)
ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
The error went away when I commented out the following line:
I believe the error is because the Product name does not remotely match the assembly name.
Why do we set this? Can we remove it? Should we do this another way?
Steps to reproduce
- Create API from Boxed Template using a --title that does not match the app name
- Update everything to .net 7
- Get error
Expected behaviour
App does not error
Template
API
.NET Boxed Version
Latest
Visual Studio Version
VS22
.NET Version
.NET 7
Metadata
Metadata
Assignees
Labels
bugIssues describing a bug or pull requests fixing a bug.Issues describing a bug or pull requests fixing a bug.