I hosted .NET Core Web API in local IIS following these steps:
- Published the project into a file/folder location
- In IIS Manager, mapped the folder location
When I browse the site from IIS, it shows the default "WeatherForecast" (sample .NET model) fine. But, when I try to browse my developed page/controller it shows nothing. Please note that, I am using datasource of SQL Server (locally) and using EF Core database first approach as ORM, and running from Visual Studio everything works fine.
I think, I need to point out my datasource anywhere during hosting in IIS.
I tried to use connection string in appsettings.json
like below, but it didn't work
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
"DBConnectionString": "Server=.\\SQLEXPRESS;Database=TourActivityExpense;Trusted_Connection=True; User ID=sa; Password=sa123;"
},
"AllowedHosts": "*"
}