Hello, everyone,
I've been trying to get my project running on an IIS server under Windows Server 2019 for days now.
I set .net Core 3.1 as the target framework in Visual Studio
Since I'm using a 32-bit DLL, I set 32-bit to true in the IIS Application Pool
It runs under Visual Studio with IIS Express, but if I publish it now and want to start it on the server, I get the following message in the browser:
In the log file I see the following message:
My csproject file looks like this:
The Web.config:
Attached are a few pictures of the settings and installations
I've been trying to get my project running on an IIS server under Windows Server 2019 for days now.
I set .net Core 3.1 as the target framework in Visual Studio
Since I'm using a 32-bit DLL, I set 32-bit to true in the IIS Application Pool
It runs under Visual Studio with IIS Express, but if I publish it now and want to start it on the server, I get the following message in the browser:
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
In the log file I see the following message:
Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'C:\inetpub\Test_Services\test.dll'. An attempt was made to load a program with an incorrect format.
File name: 'C:\inetpub\Test_Services\test.dll'
My csproject file looks like this:
Error:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
<Platforms>AnyCPU;x86</Platforms>
<UserSecretsId>f3492274-f87e-402b-ad37-821f94564fcd</UserSecretsId>
<StartupObject>test.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Prefer32Bit>true</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<Prefer32Bit>true</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<Prefer32Bit>true</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Cors" />
<!-- <PackageReference Include="Microsoft.AspNetCore.All" Version="3.1.27" /> -->
<PackageReference Include="System.Private.ServiceModel" Version="4.9.0" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.9.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.9.0" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.9.0" />
<PackageReference Include="System.ServiceModel.Security" Version="4.9.0" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project>
The Web.config:
Web.config::
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\test.dll" stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
<!--<system.webServer>
<aspNetCore processPath="dotnet" arguments=".\test.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified"/>
</handlers>
<handlerSettings>
<handlerSetting name="stackSize" value="2097152"/>
</handlerSettings>
</aspNetCore>
</system.webServer>-->
<!-- <location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\test.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location> -->
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00"/>
</wsHttpBinding>
</bindings>
</system.serviceModel>
<system.net>
<!-- erstmal herausnhemen zum test<defaultProxy>
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy> -->
</system.net>
</configuration>
Attached are a few pictures of the settings and installations