I have this old project which is in netcore 1.1 and I'm trying to run this project in my new Dev environment which is has netcore above 2.0. As you can guess when I'm trying to debug this old project my command line starts glowing like a christmas tree with all the known errors like
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\
and
- The following versions are installed:
2.1.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.2.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
So my question is how can I change my project settings without installing netcore 1.1?
Also worth to mention is that I already know how to fix this problem when working in Visual Studio with a project solution(just changing the version in project properties will fix this problem) but this project is in Visual Studio Code and it has no solution file inside the project folder.
I have already changed some settings in .csproj but without any luck.
This is what I have changed in .csproj From:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug"
Version="1.1.1" />
</ItemGroup>
</Project>
to:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
</Project>
Delete
/binand/objfolders and importMicrosoft.AspNetCore.Appin your .csproj