Skip to content

Net9 Tests do not run in Visual Studio #3193

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

Open
Wraith2 opened this issue Mar 2, 2025 · 0 comments
Open

Net9 Tests do not run in Visual Studio #3193

Wraith2 opened this issue Mar 2, 2025 · 0 comments
Assignees
Labels
Bug! 🐛 Issues that are bugs in the drivers we maintain. Triage Done ✔️ Issues that are triaged by dev team and are in investigation.

Comments

@Wraith2
Copy link
Contributor

Wraith2 commented Mar 2, 2025

When developing SqlClient using Visual Studio I want to be able to run the manual tests to make sure that I haven't broken anything. With the tests configured correctly so that they can be run correctly from the commandline it is impossible to run them from within Visual Studio.

Picking a simple test example, this is what you get:

Image

 Microsoft.Data.SqlClient.ManualTesting.Tests.AdapterTest.AutoGenBulkUpdateTest
   Source: AdapterTest.cs line 1204
   Duration: 72 ms

  Message: 
System.TypeInitializationException : The type initializer for 'Microsoft.Data.SqlClient.TdsParser' threw an exception.
---- System.TypeInitializationException : The type initializer for 'Microsoft.Data.SqlClient.SNILoadHandle' threw an exception.
-------- System.DllNotFoundException : Unable to load DLL 'Microsoft.Data.SqlClient.SNI.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)

  Stack Trace: 
TdsParser.ctor(Boolean MARS, Boolean fAsynchronous) line 34
SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) line 1567
SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) line 1444
SqlInternalConnectionTds.ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool, Func`3 accessTokenCallback) line 525
SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) line 138
DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) line 153
DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) line 802
DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) line 1977
DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) line 1361
DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) line 1261
DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) line 306
DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) line 963
DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) line 43
SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides) line 1970
SqlConnection.Open(SqlConnectionOverrides overrides) line 1413
SqlConnection.Open() line 1390
AdapterTest.AutoGenBulkUpdateTest() line 1211
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
----- Inner Stack Trace -----
TdsParserStateObjectFactory.get_EncryptionOptions() line 22
TdsParser.cctor() line 79
----- Inner Stack Trace -----
SniNativeMethods.SNIInitialize(IntPtr pmo)
SniNativeMethods.SniInitialize(IntPtr pmo) line 58
SniNativeWrapper.SNIInitialize(IntPtr pmo) line 164
SniNativeWrapper.SNIInitialize() line 278
SNILoadHandle.ctor() line 38
SNILoadHandle.ctor() line 22
SNILoadHandle.cctor() line 20

Without the ability to trigger the CI as a contributor the local test experience becomes much more important. Currently it is not useful and does not allow test information to be gathered in a sensible way.

@Wraith2 Wraith2 added Bug! 🐛 Issues that are bugs in the drivers we maintain. Triage Needed 🆕 For new issues, not triaged yet. labels Mar 2, 2025
@mdaigle mdaigle added Triage Done ✔️ Issues that are triaged by dev team and are in investigation. and removed Triage Needed 🆕 For new issues, not triaged yet. labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug! 🐛 Issues that are bugs in the drivers we maintain. Triage Done ✔️ Issues that are triaged by dev team and are in investigation.
Projects
None yet
Development

No branches or pull requests

3 participants