tldnr: How do I upgrade Microsoft.AspNetCore.App
from 2.2.0
to 2.2.2
? It's disabled in the package manager UI.
When I created a testproject I realized that Microsoft.AspNetCore.App
was version 2.2.2
(newest version) whereas in my main Api project it was 2.2.0
.
I could not update it due to
Implicitly referenced by an SDK. To update the package, update the SDK to which it belongs
I do have SDK 2.2.104 installed, which should contain 2.2.2 (I love how straight forward Microsoft is with its version numbers)
C:\Users\matthias>dotnet --list-sdks
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.402 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]
2.1.504 [C:\Program Files\dotnet\sdk]
2.1.600-preview-009472 [C:\Program Files\dotnet\sdk]
2.2.104 [C:\Program Files\dotnet\sdk]
What's the correct way of updating this all to 2.2.2
? I could set the version number for the package in the csproj
and it seems to work just fine, but I guess that's not the clean way to go. Why would the UI disable it then.
Project file is from the default template.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
Source: https://github.com/matthiaslischka/netcore222updateissue
UPDATE:
I have now added RuntimeFrameworkVersion
2.2.2
to the csproj like ESG suggested and now I get this strange view:
I've inspected the compiled DLLs with ILSpy and it seems to still be 2.2.0.0
I posted this in response to Andy's GitHub bug, but re-posting it here for further reach:
If you are using .NET Core, the only thing you need to do to update to the patch is install the latest patched runtime on the machine running the app (i.e. your servers, dev boxes, etc.).
.NET Core applications automatically roll forward to the highest patch version associated with the major/minor pair you target. This behavior can be disabled using a setting in [appname].runtimeconfig.json
but we strongly recommend you keep it to ensure you always run on the most up-to-date runtime (with all released security fixes).
While we do recommend you run on the latest patch, we recommend you do not update your app to target later patch versions as your app will fail to start if that patch doesn't exist on the target machine. Patches shouldn't be introducing APIs that you need to update to depend upon so there's no need to update the package reference.
Since you have the 2.2.2 .Net core SDK, you force the version of ASP.Net by specifying the RuntimeFrameworkVersion
in your csproj
.
<PropertyGroup>
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
</PropertyGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With