Login Fails Regardless of Correct or Incorrect Credentials

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
henryA
User
Posts: 9

Login Fails Regardless of Correct or Incorrect Credentials

Post by henryA »

Logging in throws an error that generally says "ACCESSDENIED" from the sql client. On the production environment, this page throws this error when entering the login credentials regardless of whether the credentials is the correct one or not. However, in the development environment on the localhost, it works fine, i.e login is successful upon entering the correct credentials and fails upon entering incorrect credentials.

This is for ASP.NET Maker 2021 version.

Please any suggestions as to what is causing this error and how can it be fixed?

Below is the actual error page that is thrown when trying to login.

"""
An unhandled exception occurred while processing the request.
DllNotFoundException: Unable to load DLL 'Microsoft.Data.SqlClient.SNI.dll' or one of its dependencies: Access is denied. (0x80070005 (E_ACCESSDENIED))
Microsoft.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize(IntPtr pmo)

TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SNILoadHandle' threw an exception.
Microsoft.Data.SqlClient.TdsParserStateObjectFactory.get_EncryptionOptions()

TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.TdsParser' threw an exception.
Microsoft.Data.SqlClient.TdsParser..ctor(bool MARS, bool fAsynchronous)
"""

STACK TRACE
"""
DllNotFoundException: Unable to load DLL 'Microsoft.Data.SqlClient.SNI.dll' or one of its dependencies: Access is denied. (0x80070005 (E_ACCESSDENIED))
Microsoft.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize(IntPtr pmo)
Microsoft.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize()
Microsoft.Data.SqlClient.SNILoadHandle..ctor()
Microsoft.Data.SqlClient.SNILoadHandle..cctor()
"""


MichaelG
User
Posts: 1111

Post by MichaelG »

Make sure that you have Microsoft SQL Server correctly installed in your hosting server.


aspsteve
User
Posts: 52

Post by aspsteve »

We are currently using the same server successfully for ASP.NET 2020.
We are only experiencing this issues with ASP.NET 2021.


henryA
User
Posts: 9

Post by henryA »

@MichaelG, thanks for the suggestion, but the same ASP NET Maker code with Microsoft SQL Server works on the 2020 version without issues, but not on the 2021 version of ASP NET Maker. It is exactly as @aspsteve said.

Please what do you think can be done in this case?


MichaelG
User
Posts: 1111

Post by MichaelG »

Are you running ASP.NET Core runtime 5.0.101 and hosting bundle or newer? What is your server configuration?


henryA
User
Posts: 9

Post by henryA »

Yes, we are running the latest version of ASP.NET Core 5.0, with the latest hosting bundle as well. The same Microsoft SQL Server used in production is what we also use on the localhost, and it works fine in the localhost but just not in production (AWS EC2).


MichaelG
User
Posts: 1111

Post by MichaelG »

If you are using AWS, you should check with the AWS support for the error message.

You can also double check your database connection string in "appsettings.json" (or "appsettings.Development.json" if you are using the Development environment).


Post Reply