Reputation: 399
A default ASP.NET MVC 4 project with an account controller that uses forms authentication, but this authentication give this error on IIS 7.5 on my server.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.)
How can I solve this as I cant find any connections on class.
Upvotes: 0
Views: 61
Reputation: 895
The default MVC 4 project relies on IIS Express and LocalDB, the LocalDB generated is stored in the App_Data folder.
However when changing the project to run under full IIS you are advised to switch to using SQL Express. For this you will need to create a database and set up the relevant connection string. Assuming your application has the relevant permissions and the WebSecurity.InitializeDatabaseConnection has autoCreateTables set to true the relevant tables will automatically be created.
The default database initialization is done via the InitializeSimpleMembershipAttribute we can be found in Filters/InitializeSimpleMembershipAttribute.cs this attribute is then applied to the AccountController.
Upvotes: 1
Reputation: 116
You should check Windows log as suggested in exception message. Connection string is in the web.config file of your web application.
Upvotes: 0