locked
How to compile using 2.2.6? RRS feed

  • Question

  • User969992919 posted

    Hi,

    I have my ASP.NET Web API project and in the project properties I selected target Framework as .NET Core 2.2 (because that's the latest listed in my Visual Studio 2019)

    but I am having a problem with the project when I upload to my host so they asked me to recompile using 2.2.6

    How can I do that please?

    Thanks,

    Jassim

    Sunday, July 21, 2019 8:45 PM

All replies

  • User969992919 posted

    This is what I am getting:

    Monday, July 22, 2019 12:18 AM
  • User1120430333 posted

    I would say uninstall the version you want to replace and install the new version. You can go to the Visual Stuido project and use Nuget there at the project level and select Installed Libraries and see what the project has installed and uninstall it. 

    Monday, July 22, 2019 12:59 AM
  • User969992919 posted

    The uninstall button is disabled

    Monday, July 22, 2019 1:06 AM
  • User1120430333 posted

    I would say investigate, but I will say that it may be your only path.

    https://docs.microsoft.com/en-us/dotnet/core/versions/remove-runtime-sdk-versions?tabs=windows

    Monday, July 22, 2019 3:19 AM
  • User711641945 posted

    Hi jrahma,

    1.You could refer to the following link about how to migrate from ASP.NET Web API to ASP.NET Core:

    https://docs.microsoft.com/en-us/aspnet/core/migration/webapi?view=aspnetcore-2.2

    2.Right-click project->Edit Project File , change the version like below and rebuild the project :

      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.6" />
        <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
      </ItemGroup>

    Best Regards,

    Rena

    Monday, July 22, 2019 9:59 AM
  • User969992919 posted

    Yeah that changed the Microsoft.AspNetCore.App

    What about Microsoft.NETCore.App? it is not there in the csproj file and it is still blocked?

    Monday, July 22, 2019 11:10 AM
  • User1120430333 posted

    Yeah that changed the Microsoft.AspNetCore.App

    What about Microsoft.NETCore.App? it is not there in the csproj file and it is still blocked?

    I loaded my Core 2.2 solution into VS2019, went to project Properties and looked at the various versions of Core I could select. It also had a 'Install other versions' that I could select and install at the download site. When I went there,  I could select the 2.2.6 runtime and install it.

    Monday, July 22, 2019 11:57 AM
  • User-474980206 posted
    Here is the download link. Pick the sdk that matches their version of visual studio you are using.

    https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2.6/2.2.6.md

    Monday, July 22, 2019 2:19 PM
  • User969992919 posted

    I have installed both dotnet-sdk-2.2.301-win-x64.exe SDK and dotnet-runtime-2.2.6-win-x64.exe runtime.

    Now when I try to install it shows Uninstall or Repair which means it's already installed on my machine.

    I am able to select the .NET Core 2.2 in the Target Framework

    But I am still not able to update the Microsoft.NETCore.App, as it is still showing Blocked by project and the version installed is 2.2.0

    Monday, July 22, 2019 2:31 PM
  • User1120430333 posted

    Again, you can go to Control Panel 'Add/Remove Program' and uninstall a Core SDK version. If it were me, I would uninstall all of them. Why do you need all of them if your are just interested in the 2.6 Runtime?

    Monday, July 22, 2019 3:05 PM
  • User969992919 posted

    I deleted 2.1 as an example as you can see in the screenshot but it is still showing in my project properties

    Monday, July 22, 2019 3:12 PM
  • User475983607 posted

    You are confusing the framework with the run-time/SDK version.  

    Seems strange your host requires 2.2.6 being that it was released on 7/9/2019.  

    Can you explain the original problem and any error received rather than asking for a specific solution.

    Monday, July 22, 2019 3:29 PM
  • User969992919 posted

    This is my problem followed by the email from host's tech support:

    Monday, July 22, 2019 4:50 PM
  • User475983607 posted

    The email indicates that you did not configure the host or deploy the application correctly.

    The error message is generic.  Generally this error pops up for many reasons.  First, I recommend that you read the ASP.NET Core deployment instructions.

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/?view=aspnetcore-2.2

    Second, be sure to publish a self-contained application.

    https://docs.microsoft.com/en-us/dotnet/core/deploying/

    Lastly, read the troubleshooting guide.

    https://docs.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-2.2

    Monday, July 22, 2019 5:26 PM
  • User711641945 posted

    Hi jrahma,

    jrahma

    What about Microsoft.NETCore.App?

    Could you share why you use this library?Actually you need the library of Microsoft.AspNetCore.App.

    I suggest that you could follow the below link to remigrate Asp.Net to Asp.Net core:

    https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-2.2

    Best Regards,

    Rena

    Tuesday, July 23, 2019 2:10 AM
  • User10672785 posted

    Try adding this to your project

    <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.6" />
    <PackageReference Update="Microsoft.NETCore.App" Version="2.2.6" />
    </ItemGroup>

    I think this should work

    Wednesday, August 7, 2019 3:02 PM