Home > Net >  Asp.net Core API Deploying with a database on IIS
Asp.net Core API Deploying with a database on IIS

Time:12-06

I'm trying to deploy an API on IIS. But no matter how I try to do it, I can't solve the following problem.

When I try to deploy asp.net core example api there is no problem with it. When I call an endpoint there are data. enter image description here

If I try to deploy my api that uses a database I got an error.

The problem that I got when I try write an endpoint is:

enter image description here

I think it is a database permission problem. IIS settings are below

enter image description here

Connection string is below

"Local": "server=(localdb)\mssqllocaldb; database=eahworksafety;user id=eah;Password=eah;Integrated Security=false;"

MSSQL settings are below

enter image description here

I try to deploy an api locally on IIS webserver. I get an error when I try to reach an endpoint.

CodePudding user response:

first of all, you can see more deatiales about this problem by going on your windows, search [Event viewer] ->then enter to the section windows logs->Application and see the problems.

secound, what I noticed that you are trying to connect to the localDb that exsist in visual studio by default, I have faced the same problem befor so I changed the connection string form the localDB to sql server 2019 that I instulled and worked.

  • Related