IIS 7.5에서 호스팅하려는 asp.net 핵심 웹 API 프로젝트가 있습니다.
아래 기사에서 제안한 것처럼
구성 파일 'appsettings.json'을 찾을 수 없으며 선택 사항이 아닙니다.
아래는 내 "appsettings.json"파일입니다.
{
"ConnectionStrings": {
"SchedulerConnection": "Server=ABC\\SQL2012;Database=SchedulerDb;persist security info=True;Integrated Security=SSPI;"
}
}
그리고 "startup.cs"에서 아래와 같은 연결 문자열 값을 얻습니다.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<SchedulerContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("SchedulerConnection"),
b => b.MigrationsAssembly("WebTest.API")));
}
로컬 IISExpress에서 파일을 실행하는 코드이지만 IIS 7.5에 배포하는 동안 500 서버 오류가 발생합니다.
여기서 무엇이 잘못 되었습니까? 제안 해주세요 !!
아래는 내 "publishOptions"입니다.
"publishOptions": {
"include": [
"wwwroot",
"appsettings.json",
"web.config"
]
},
SQL Server에 대한 새 로그인 "IIS APPPOOL [App Pool Name]"을 생성하고 나중에 "IIS APPPOOL [App Pool Name]"에 웹 사이트 / IIS 응용 프로그램을 할당합니다.
감사,
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다