Environment:
W11 pro 23H2 all updated
Visual Studio 17.9.6
IIS Version 10.0.22621.1
SQL Server 2022 configuration, SSMS 20.1.10
I created a CoreWeb App: using Visual Studio, SQLexpress. The App runs well in Visual Studio.
Publishing it to ‘Folder’ works as well. Calling the App using ‘localhost:84’ works as well …..
…. as long as I’m NOT restarting my PC!
I.e.:
whenever I (re)start my machine, the only way to run my App via IIS is to first ‘Publish’ again. I just open my App in VS and go (directly) to ‘Publish’. From then on I can call my App ‘localhost:84’ and it works fine …. as said: until the next restart!
According to the ‘Events log’ it is related to ‘SQL Server not found’
Application: w3wp.exe
CoreCLR Version: 8.0.424.16909
.NET Version: 8.0.4
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.Data.SqlClient.SqlException (0x80131904): 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: 26 – Error Locating Server/Instance Specified)
Some Stack issues recommend to start ‘SQL Server/Browser Agent’ in SQL server config; its on ‘automatic’.
Starting gives error:
The request failed or the service did not respond in a timely fashion.
but event log says:
SQLServerAgent service successfully started.
and same timestamp immediately afterwards:
SQLServerAgent service successfully stopped.