S
S
super152019-11-29 19:31:28
ASP.NET
super15, 2019-11-29 19:31:28

How to deploy Asp.Net Core app to Heroku?

When deploying from a Heroku site, the following error occurs:

The specified framework 'Microsoft.NETCore.App', version '2.0.9' was not found.
remote: - The following frameworks were found:
remote: 3.0.0 at [/app/tmp/cache/dotnet/3.0.100/sdk/shared/Microsoft.NETCore.App]

I am attaching the .csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>


  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.4" />
  </ItemGroup>


  <ItemGroup>
    <Reference Include="M2Mqtt.Net">
      <HintPath>M2Mqtt.Net.dll</HintPath>
    </Reference>
  </ItemGroup>


  <ItemGroup>
    <PackageReference Update="Microsoft.NETCore.App" Version="2.2.8" />
  </ItemGroup>


  <ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>

</Project>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-12-01
@yarosroman

It is clearly written that .net version 3.0 is installed there, and you have it compiled for 2.0. Make a self contained assembly and upload it to the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question