Search code examples
c#asp.net.netwebapiplesk

Deploy WebApi on Plesk


I am encountering a problem while deploying my web API application on Plesk panel in a Windows hosting environment. My appsettings.json file looks like this: { "dbConnectionString": "Data Source=.\\MSSQLSERVER2019;Initial Catalog=<DataBaseName>;User ID=<UserName>;Password=<Password>" } <?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers> <aspNetCore processPath=".\AppName.RestApi.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" /> </system.webServer> </location> </configuration> I am encountering a 503 error. I tried changing the hosting model to outofprocess, but it resulted in a 502.5 error.


Solution

  • i found problem. i figured out that .net version on host is version 7 but my project built with version 8.

    so i have to downgrade my project.