-
Notifications
You must be signed in to change notification settings - Fork 206
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
[AOT7.0]A type initializer threw an exceptio #2280
Comments
|
why asp.net core need |
i use dotnet is from C:\Program Files\dotnet |
debug program , is |
|
Because there was a problem with the code running after AOT was compiled, I deleted many 7.0 folders on the computer and uninstalled it, resulting in this problem that cannot be fixed regardless of whether it is reinstalled or not. I found this problem after my computer was reinstalled, which led me to start researching whether it was a version problem, and then repeatedly uninstall and install .net.7.0, so I violently deleted many net7.0 folders on the computer, and uninstalled, resulting in this problem has not been repaired whether it is reinstalled or not. |
The native AOT projects lives in http://github.com/dotnet/runtime now. Please open any issues http://github.com/dotnet/runtime. Also, include steps to reproduce the issue. Note that SqlClient is not yet compatible with AOT and trimming. This is tracked by dotnet/SqlClient#1947. |
dotnet/SqlClient/issues#1947 test |
How should I reinstall the relevant environment?, I used Visual Studio to re-check 143 related C++ libraries, nothing worked, I also tried to re-download the dotnet package installation still has no effect, but I tested the demo mentioned on runtimelab, I 6.0 7.0 net compiled this simple demo is no problem @jkotas |
clear bin obj Folder? Succeeded again, but again this problem arises because I currently have 7.0.5 installed again, I think 7.0.5 has some bugs, is not compatible |
Can you please try to publish a small project that opens SqlClient connection with native aot:
Does the native AOT binary fail to sni.dll on your machine? |
我现在测试demo是正常的,但是我还要确认下现在真实项目是什么情况,为了解决这些问题,我升级 或者降级得到了不同的错误,8.0的aot错误更为严重 |
I just uninstalled 7.0.5 and 8.0 which caused this annoying error again |
I think I upgrade to 7.0.5 will get SQL client error, upgrade to 8.0 will get swagger error, this is the result of my previous test, 8.0 config manager I changed to write files directly, but there are more errors waiting for me to solve, I have to downgrade, and in the case of 8.0 I did not do AOT compilation, just run with Visual Studio and got that error
|
So I think what I can do at the moment is downgrading below 7.0.5 can solve more problems, but my computer in the company seems to be unable to fix CVTRES: fatal error CVT1103: Error, I have reinstalled these nets, those small demos can run normally, my home computer compiles very slowly, but successfully makes the project not report errors, my company's computer was also used before the 7.0 lower version was also solved by me The error has been running stably for several months |
i just run |
|
Small demos are fine, but real projects are still this throw error
|
small demo is work
|
uninstall 8.0 dotnet-sdk-7.0.203-win-x64 (1) 7.0.5 all package ,delete all 7.0.5 folder 这次没有出现编译错误了,sql 错误也没有出现了,因此问题就是7.0.5导致的 |
Due to some errors in 7.0.5 and 8.0 that I cannot solve, I have to downgrade to 7.0.4. However, I am worried about the future and will definitely need to upgrade. How can I solve these problems in the future? For example, in 8.0, the swagger was abnormal |
You need to pay attention to warnings like "Assembly 'System.Data.SqlClient' produced trim warnings.". These warnings tell you that the code is not trimming or AOT compatible, and it can break unexpectedly. There is no trimming and AOT compatible replacement of swagger at this time. |
@jkotas Thank you. I noticed those compilation warnings, but because the previous version was able to run and the error this time is different from when I was using the previous. net7.0 version, I don't know how to modify rd.xml or source generation to solve this problem |
2 similar comments
@jkotas Thank you. I noticed those compilation warnings, but because the previous version was able to run and the error this time is different from when I was using the previous. net7.0 version, I don't know how to modify rd.xml or source generation to solve this problem |
@jkotas Thank you. I noticed those compilation warnings, but because the previous version was able to run and the error this time is different from when I was using the previous. net7.0 version, I don't know how to modify rd.xml or source generation to solve this problem |
|
A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
inspect the InnerException's StackTrace property. System.Collections.ListDictionaryInternal type:System.TypeInitializationException at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x159\r\n at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnNonGCStaticBase(StaticClassConstructionContext*, IntPtr) + 0x1c\r\n at System.Data.SqlClient.TdsParser..ctor(Boolean MARS, Boolean fAsynchronous) + 0x28\r\n at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) + 0x20f\r\n at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) + 0x29f\r\n at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken) + 0x432\r\n at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) + 0x541\r\n at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) + 0x8d\r\n at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) + 0x45f\r\n at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) + 0xdb\r\n at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) + 0x428\r\n at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) + 0xc9\r\n at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) + 0x686\r\n at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) + 0x17d\r\n at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions) + 0x39\r\n at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) + 0x1e3\r\n at System.Data.SqlClient.SqlConnection.Open() + 0xff\r\n at webapi_mes.baseframework.SqlHelper.Open() + 0x199",The text was updated successfully, but these errors were encountered: