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

Cameron Loomis 1 Reputation point
2021-01-14T19:50:02.597+00:00

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>

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,252 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. XuDong Peng-MSFT 10,096 Reputation points Microsoft Vendor
    2021-01-15T02:57:15.87+00:00

    Hi @Cameron Loomis ,

    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.