Skip to content

[5.0.100-rc.2.20471.7] Single File for OpenMU/HandyControl/TuringTrader target 5.0 app, tests failed #42665

@jiangzeng01

Description

@jiangzeng01

Application Names: OpenMU
OS: Windows 10 RS5
CPU: X64
.NET Build Number: 5.0.100-rc.2.20471.7
App Location: \appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\Apps\OpenMU-5.0
App Source: \appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\AppSources\OpenMU-5.0
DevDiv issue: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1218902

Repro steps:
Retarget 5.0
Single File exe was created by
dotnet publish MUnique.OpenMU.Startup.csproj -r win-x64 -p:PublishSingleFile=true --self-contained true
using 5.0.100-rc.2.20471.7 SDK
Copy '\appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\Apps\OpenMU-5.0' to local machine.
Double-click on MUnique.OpenMU.Startup.exe

Expected Result:
Open OpenMU app successful.

Actual Result:
The OpenMU app thrown exception and unable to start.

Findings:
According to the exception, we think it might be caused by related Pull Request:
#40974

Exception from command window for OpenMU:

Unhandled exception. System.TypeInitializationException: The type initializer for 'MUnique.OpenMU.Persistence.EntityFramework.ConnectionConfigurator' threw an exception.
 ---> System.NotSupportedException: CodeBase is not supported on assemblies loaded from a single-file bundle.
   at System.Reflection.RuntimeAssembly.get_CodeBase()
   at MUnique.OpenMU.Persistence.EntityFramework.ConnectionConfigurator.LoadSettings()
   at MUnique.OpenMU.Persistence.EntityFramework.ConnectionConfigurator..cctor()
   --- End of inner exception stack trace ---
   at MUnique.OpenMU.Persistence.EntityFramework.ConnectionConfigurator.Configure(DbContext context, DbContextOptionsBuilder optionsBuilder)
   at MUnique.OpenMU.Persistence.EntityFramework.EntityDataContext.OnConfiguring(DbContextOptionsBuilder optionsBuilder)
   at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
   at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
   at Microsoft.EntityFrameworkCore.DbContext.get_Model()
   at MUnique.OpenMU.Persistence.EntityFramework.GenericRepository`1..ctor(PersistenceContextProvider contextProvider)
   at MUnique.OpenMU.Persistence.EntityFramework.AccountRepository..ctor(PersistenceContextProvider contextProvider)
   at MUnique.OpenMU.Persistence.EntityFramework.RepositoryManager.RegisterRepositories(PersistenceContextProvider contextProvider)
   at MUnique.OpenMU.Persistence.EntityFramework.PersistenceContextProvider..ctor()
   at MUnique.OpenMU.Startup.Program.PrepareRepositoryManager(Boolean reinit, Boolean autoupdate)
   at MUnique.OpenMU.Startup.Program..ctor(String[] args)
   at MUnique.OpenMU.Startup.Program.Main(String[] args)

cc @dotnet-actwx-bot

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions