question

CameronLoomis-6983 avatar image
0 Votes"
CameronLoomis-6983 asked XuDongPeng-MSFT commented

ASP.net "The System Cannot Find The File Specified" after web app deployment.

56812-screenshot-3.pngI have been deploying my web app through Azure. I do not get any errors when deploying/building the app. The error occurs when trying to log into an account on the site. I have also created a default pre-built http://asp.net web app that gets created with the start of a new project, and deployed that. That app also gets the same error. At first, I thought it was something I was doing, but then I saw the same error on the pre-built app. I haven't had this problem before starting my last project, and now it happens on every project I create. The error I keep receiving is below.

Note: Something that might be a contributing factor is I am on a new computer as of recent. My last computer never had this issue, but my new computer does. I'm not able to try it on my last computer as it doesn't work anymore.

Here is the default connection string that is auto generated upon creation of a web app. It is in relation to a database that tracks user accounts/roles/etc. when the option for individual user accounts is selected at creation:

<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-OrokinNetworkRebuild-20210114121722.mdf;Initial Catalog=aspnet-OrokinNetworkRebuild-20210114121722;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

dotnet-csharpdotnet-aspnet-webforms
screenshot-3.png (677.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

XuDongPeng-MSFT avatar image
0 Votes"
XuDongPeng-MSFT answered XuDongPeng-MSFT commented

Hi @CameronLoomis-6983 ,

According to your description, I found this exception in the stack information. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found .... I think this is the main reason for your problem.

Generally issues like this are related to any of the following need to be looked at:

  • firewall settings from the web server to the database server

  • connection string errors

  • enable the appropriate protocol pipes/ tcp-ip

And the exception may be caused by different reasons and have different error codes, so you need to check the exception information in detail.
For example, it may appear something like:

  • error: 26 -Unable to locate a Local Database ...

  • error: 52 -Error Locating Server/Instance Specified

Hope this can help you.

Best regards,
Xudong Peng



If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am just a student, so a lot of this is self teaching. Some of this did kind of go over my head. I don't know much about what these issues mean, or how to resolve them/find out what is causing the error. I am just confused as to why I am getting this error straight off of the default ASP.net web application that is built from starting a new project. Something had to have changed over the last few months, because I wasn't getting these errors back then. Maybe there is a NuGet package I am missing? Or some setting has been changed that modifies the auto generated structure.

0 Votes 0 ·

Hi @CameronLoomis-6983 , as I mentioned before, you need to carefully check the stack information to see its specific error information.
According to my search, the error message may be because the SQL SERVER service is not turned on, or the connection string in web.config is invalid,etc.
You could also refer to this case for more possible solutions.


0 Votes 0 ·