Unable to update to .Net 6

2 Answers 919 Views
General Discussions
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Richard asked on 09 Nov 2021, 01:43 PM

I'm unable to update my project to target .Net 6 as it causes a Nuget conflict with the CodeAnalysis library when using the "Telerik.UI.for.AspNet.Core 2021.3.914" and "Microsoft.PowerShell.Commands.Utility 7.2.0" packages.

Is this something that can be looked at in the next release / internal build of the UI AspNet.Core package?

Error NU1605 Detected package downgrade: Microsoft.CodeAnalysis.CSharp from4.0.0-6.final to 3.8.0.
Reference the package directly from the project to select a different version.
-> Microsoft.PowerShell.Commands.Utility 7.2.0 -> Microsoft.CodeAnalysis.CSharp (>= 4.0.0-6.final) -> Microsoft.CodeAnalysis.CSharp (>= 3.8.0)

Thanks,
Richard

2 Answers, 1 is accepted

Sort by
0
Accepted
Aleksandar
Telerik team
answered on 12 Nov 2021, 06:38 AM

Hello Richard,

We've had a similar report recently where the issue was related to an incompatibility between "Microsoft.CodeAnalysis" Version="4.0.1" and  "Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0".

The project could be built with "Microsoft.CodeAnalysis" Version="4.0.0" and  "Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0".

This screencast shows a test in a simple Microsoft WebApplication (non-Telerik) application, so for the time being I can suggest checking the versions of the "Microsoft.CodeAnalysis"  and "Microsoft.VisualStudio.Web.CodeGeneration.Design" packages and if the above is the reason sticking with "Microsoft.CodeAnalysis" Version="4.0.0" and  "Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" for the time being.

If that is not the case consider sharing further details, so we could investigate further.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 12 Nov 2021, 10:28 AM

Thank you very much, Aleksandar.

Explicitly setting the CodeAnalysis package version in the project config fixed it for me. I would have thought that nuget and these packages would have all defaulted to the highest required version if none was set but that doesn’t seem to be the case for me. 

For anyone else that sees this in the future here is my broken and fixed config. 

 

BROKEN

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>	  	  
    <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2021.3.1109" />
    <PackageReference Include="Microsoft.PowerShell.Commands.Utility" Version="7.2.0" />
  </ItemGroup>

</Project>


WORKING

<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.0-6.final" />

<PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2021.3.1109" /> <PackageReference Include="Microsoft.PowerShell.Commands.Utility" Version="7.2.0" /> </ItemGroup> </Project>

 

Richard

Tags
General Discussions
Asked by
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Aleksandar
Telerik team
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or