I have a asp.net core web api project which I am trying to host in IIS 7.5.
As suggested by below article,
The configuration file 'appsettings.json' was not found and is not optional
Below is my "appsettings.json" file,
{
"ConnectionStrings": {
"SchedulerConnection": "Server=ABC\\SQL2012;Database=SchedulerDb;persist security info=True;Integrated Security=SSPI;"
}
}
And in "startup.cs" I am getting connection string value like below,
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<SchedulerContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("SchedulerConnection"),
b => b.MigrationsAssembly("WebTest.API")));
}
The code running file in local IISExpress, but throw 500 Server Error while deploying to IIS 7.5.
What is wrong here? please suggest!!
Below is my "publishOptions",
"publishOptions": {
"include": [
"wwwroot",
"appsettings.json",
"web.config"
]
},