Skip to content

Can't target a specific version #33941

@alons1

Description

@alons1

I'm trying to target asp.net core 5.0.5
On my dev machine I've installed hosting bundle 5.0.5, 5.0.6 and I also have 5.0.7 sdk (5.0.301) which I got with VS 2019.
On my production env I have hosting bundle 5.0.5

When trying to run the project on prod, I get this in the browser:
HTTP Error 500.31 - Failed to load ASP.NET Core runtime

And this in the Event Viewer:

Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.7' was not found.
   The following frameworks were found:
      2.1.15 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      3.1.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      5.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

I have this in my .csproj file

<PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <RuntimeFrameworkVersion>5.0.5</RuntimeFrameworkVersion>
    <Version>1.0.0</Version>
    <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
    <OutputType>WinExe</OutputType>
    <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
  </PropertyGroup>

And this in my web.config

<?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="bin\Release\net5.0\CouchbaseAPI.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\" hostingModel="outofprocess">
        <environmentVariables>
          <environmentVariable name="ASPNETCORE_HTTPS_PORT" value="443" />
          <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
        </environmentVariables>
      </aspNetCore>
    </system.webServer>
  </location>
  <system.webServer>
    <httpErrors errorMode="Detailed" />
  </system.webServer>
</configuration>

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions