I made my simple project that save my ideas to "(localdb)\mssqllocaldb".
namespace publish.Models
{
public class idea
{
public int Id { get; set; }
public string Name { get; set; }
}
}
I use asp.net.core 6.0 - mvc. I published this project to local folder and deploy using iis manager. However after publishing, I tried browse but failed. Because it is failed to connect local database. How can I resolve this problem?
I saw lecture the name is "How to Publish an ASP .NET Core 6 Website _ APP on a Windows OS and Fix Database Connection Problem". I tried to resolve using this method. From "Microsoft Sql Server management studio", I create new login as sql server authentication. Then change the connection string in appsetting.json like that
"ConnectionStrings": {
"publishContext": "Server=(localdb)\\mssqllocaldb;Database=publish.Data;uid=ali12;pwd=123;"
}
And published using this connectionstrings. However, I saw error message like this
Error.
An error occurred while processing your request. Request ID: 00-e7f938a225da4cf8d5148cfd354c0f34-01a9fa13f2a60d36-00 ...
=============================================== Dear Jason Pan, I tried to resolve my problem from your guidance. However, I didn`t success.
I also using localdb and facing the same issue. You can add below code in web.config file, then you will get more detailed error message.
My sample web.config file.
And get below error message.
Solution
You need to install the Microsoft SQL Server in your server and make sure it can be accessed.