I’m developing an application using a code-first approach, but I encounter an error that prevents the database from being created when I launch the application. I’m working with SQL Server 2019 and I need assistance. The error message states:
Server Error in '/' Application.
The system cannot find the file specified
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception details: System.ComponentModel.Win32Exception: The system cannot find the file specified
The relevant part of my code is as follows:
// Ensure that login failures do not invoke lockout, only two-factor authentication
var loginResult = await SignInManager.PasswordSignInAsync(user.Email, user.Password, user.RememberMe, triggerLockout: false);
switch (loginResult)
{
// Additional logic
}
I’ve confirmed that my connection string is accurate, yet it’s still failing. Here is the connection string I have in web.config
:
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=.;Initial Catalog=DefaultConnection;Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
Any guidance would be greatly appreciated.