-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
TypeInitializationException when calling HostBuilder.Build() #88518
Comments
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsDescriptionwhen i try to start my application, this exception throws immediately and causes the application to crash note: if i don't attach my application to debugger, these message will appear
if i do attach to debugger, we will get these
Reproduction Steps1.Download and install .Net 8 nightly build from https://github.com/dotnet/installer#table Expected behaviorno errors occur and the application runs smoothly Actual behavioran exception throws immediately and causes the application to fail Regression?this problem did not occur in previous builds Known WorkaroundsNo response Configuration.NET VersionMicrosoft.NETCore.App8.0.0-preview.7.23356.10 Microsoft.Extensions.Hosting8.0.0-preview.7.23356.16 OS InfomationVersionWindows 11 Build 10.0.25393 Archx64 Other informationNo response
|
Tagging subscribers to this area: @dotnet/area-system-runtime-compilerservices Issue DetailsDescriptionwhen i try to start my application, this exception throws immediately and causes the application to crash note: if i don't attach my application to debugger, these message will appear
if i do attach to debugger, we will get these
Reproduction Steps1.Download and install .Net 8 nightly build from https://github.com/dotnet/installer#table Expected behaviorno errors occur and the application runs smoothly Actual behavioran exception throws immediately and causes the application to fail Regression?this problem did not occur in previous builds Known WorkaroundsNo response Configuration.NET VersionMicrosoft.NETCore.App8.0.0-preview.7.23356.10 Microsoft.Extensions.Hosting8.0.0-preview.7.23356.16 OS InfomationVersionWindows 11 Build 10.0.25393 Archx64 Other informationNo response
|
This is related to #87857 cc @ericstj @stephentoub This exception means that assemblies built before this change are mixed and matched with assemblies built after this change. This incoherency is "by design" in our current process for producing nightly builds of the SDK. The root cause will be addressed by https://github.com/dotnet/arcade/tree/main/Documentation/UnifiedBuild project in .NET 9. This issue with go way on its own in several days. Please wait a week for this change to propagate to all places and then try again. |
Yes, this is due to a mismatch between the runtime in the SDK installer and the runtime required by the nightly built Microsoft.Extensions packages. Any change where a package depends on API we've added in the runtime will face this same problem. As @jkotas mentions you can wait for our runtime changes to flow up to the installer and install a new nightly build. Alternatively you can install the nightly runtime, which would upgrade the one installed by the SDK. Or just use a slightly older build of Microsoft.Extensions that matches the build of runtime which is in the SDK you installed. |
Description
when i try to start my application, this exception throws immediately and causes the application to crash
note: if i don't attach my application to debugger, these message will appear
if i do attach to debugger, we will get these
Reproduction Steps
1.Download and install .Net 8 nightly build from https://github.com/dotnet/installer#table
2.Create a Console Application and write code to call
Microsoft.Extensions.Hosting.HostBuilder.Build()
3.After build and run this application, this error will occur
Expected behavior
no errors occur and the application runs smoothly
Actual behavior
an exception throws immediately and causes the application to fail
Regression?
this problem did not occur in previous builds
Known Workarounds
No response
Configuration
.NET Version
Microsoft.NETCore.App
8.0.0-preview.7.23356.10
Microsoft.Extensions.Hosting
8.0.0-preview.7.23356.16
OS Infomation
Version
Windows 11 Build 10.0.25393
Arch
x64
Other information
No response
The text was updated successfully, but these errors were encountered: