Microsoft.CodeAnalysis.* issues again

2 Answers 876 Views
General Discussions
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
DoomerDGR8 asked on 07 Dec 2023, 09:32 AM | edited on 07 Dec 2023, 10:05 AM

So we have this recurring issue every time:

Version conflict detected for Microsoft.CodeAnalysis.CSharp.Workspaces.
Install/reference Microsoft.CodeAnalysis.CSharp.Workspaces 4.8.0-3.final directly to project ProjectName to resolve this issue.

 ProjectName -> Microsoft.VisualStudio.Web.CodeGeneration.Design 8.0.0 -> Microsoft.VisualStudio.Web.CodeGenerators.Mvc 8.0.0 -> Microsoft.VisualStudio.Web.CodeGeneration 8.0.0 -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 8.0.0 -> Microsoft.VisualStudio.Web.CodeGeneration.Core 8.0.0 -> Microsoft.VisualStudio.Web.CodeGeneration.Templating 8.0.0 -> Microsoft.VisualStudio.Web.CodeGeneration.Utils 8.0.0 -> Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.8.0-3.final) 
 ProjectName -> Telerik.UI.for.AspNet.Core 2023.3.1114 -> Microsoft.CodeAnalysis 4.4.0 -> Microsoft.CodeAnalysis.CSharp.Workspaces (= 4.4.0).

Now, Microsoft.CodeAnalysis and all DLLs are at v4.8. I have just installed Microsoft.CodeAnalysis v4.8 but I am getting the above error (it's not a warning, but an error). This has happened a few times before. I keep adding numerous DLLs until the error becomes a persistent warning. Is there a more professional solution to this?

DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
commented on 07 Dec 2023, 09:41 AM | edited

Here is what it takes to get only warnings:

    <ItemGroup>
        <PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0" />
    </ItemGroup>

The error becomes 7 warnings:


Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Features 4.8.0-3.final requires Microsoft.CodeAnalysis.Common (= 4.8.0-3.final) but version Microsoft.CodeAnalysis.Common 4.8.0 was resolved

Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Features 4.8.0-3.final requires Microsoft.CodeAnalysis.CSharp (= 4.8.0-3.final) but version Microsoft.CodeAnalysis.CSharp 4.8.0 was resolved

Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Features 4.8.0-3.final requires Microsoft.CodeAnalysis.CSharp.Workspaces (= 4.8.0-3.final) but version Microsoft.CodeAnalysis.CSharp.Workspaces 4.8.0 was resolved.

Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Features 4.8.0-3.final requires Microsoft.CodeAnalysis.Workspaces.Common (= 4.8.0-3.final) but version Microsoft.CodeAnalysis.Workspaces.Common 4.8.0 was resolved.

Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.Features 4.8.0-3.final requires Microsoft.CodeAnalysis.Common (= 4.8.0-3.final) but version Microsoft.CodeAnalysis.Common 4.8.0 was resolved.

Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.Features 4.8.0-3.final requires Microsoft.CodeAnalysis.Workspaces.Common (= 4.8.0-3.final) but version Microsoft.CodeAnalysis.Workspaces.Common 4.8.0 was resolved.

Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.Scripting.Common 4.8.0-3.final requires Microsoft.CodeAnalysis.Common (= 4.8.0-3.final) but version Microsoft.CodeAnalysis.Common 4.8.0 was resolved.
 
Nikolay
Top achievements
Rank 1
Iron
commented on 08 Dec 2023, 03:57 PM | edited

.
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
commented on 08 Dec 2023, 06:08 PM

Ultimately, thesèreferences solved the issue for me:

    <ItemGroup>
        <PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.Features" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.Scripting.Common" Version="4.8.0" />
        <PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0" />
    </ItemGroup>

 

JeffVisibilEDI
Top achievements
Rank 1
Iron
commented on 09 Jan 2024, 12:09 AM

Adding references to the Microsoft.CodeAnalysis packages is a workaround.

There is a discrepancy in the dependencies of the Telerik UI toolset for .NET Core vs .NET 8 itself. The Telerik toolset requests for Version 4.4 ONLY of the several packages, whereas .NET 8 specifies Version 4.8. 

If the package references are not included, the solution cannot compile. If they are include, then each project within the solution that references these packages  gives a "version incompatible" warning (but compiles and runs).

In my view, if Telerik states that their toolset is compatible with .NET 8 (or .NET7 for that matter - I had the same issues before I updated to V8!), then they need to set up the dependencies to be consistent. The Nuget tools say that these packages should not be referenced directly by projects. But yet they have to be referenced directly because of this problem.

Alexander
Telerik team
commented on 09 Jan 2024, 03:40 PM

Hi Jeffrey,

I personally understand your point of view, as it indeed makes complete sense in terms of providing a suite of components that is in strong symbiosis with Microsoft's strategies.

Due to recent reports, I am happy to let you know that we are already working toward migrating the dependencies and hopefully, this will not be necessary for our upcoming version.

We apologize once again for the inconvenience. Your feedback is invaluable to us and I assure you, it is not taken for granted.

2 Answers, 1 is accepted

Sort by
0
Nikolay
Top achievements
Rank 1
Iron
answered on 08 Dec 2023, 03:57 PM
I am having the same issue when updating to the latest KendoUI version (2023.3.1114). Updating to the internal build (2023.3.1129) doesn't help either.
0
Alexander
Telerik team
answered on 11 Dec 2023, 04:15 PM

Hello,

A similar subject has been discussed in the following forum thread that goes more into detail, accompanied by a standalone Telerik UI for ASP.NET Core sample with ".NET8" as a target framework and the "Microsoft.EntityFrameworkCore.Tools" dependency:

To be frank, we are currently in the process of considering whether we can proceed with an effort of bumping the "CodeAnalysis" dependency on our side. To give you more context we have stalled this process since the library currently supports prior .NET Core incarnations.

Clients or corporations that depend on prior .NET Core frameworks that are supported (for example 3.1), would inevitably have to migrate their dependencies which may prove intangible - given their infrastructure.

However, we are currently striving to follow Microsoft's strategy when it comes to the support of ''LTS", "STS"  packages. I am personally taking on the responsibility of keeping this thread posted. In order for the community to be familiar when our migrational efforts are initiated.

To sum up, at this stage, the majority of the packages you have outlined are external and we depend indirectly on them. Hence, you should be able to update the respective versions as illustrated in the aforementioned forum thread.

I hope this helps.

Kind Regards,
Alexander
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Justin
Top achievements
Rank 1
commented on 11 Feb 2024, 06:46 PM

Has any progress been made on this? We are using the latest .NET and the latest ASP.NET Identity and it is causing an irreconcilable conflict. We have been waiting for a solution to this since November.

This has brought the admin portion of our project to a halt for months and is making us regret using Telerik.

I understand wanting legacy support but perhaps splitting the builds and creating a .NET 8 package is in order. I believe most of us are trying to stay on the latest .NET to avoid the costs of later migration.

I will open a ticket, although I don't know what can be done until Telerik decides to address this.

Alexander
Telerik team
commented on 12 Feb 2024, 08:03 AM

Hi Justin,

I'm happy to let you know that our developer subject matter experts have embarked on the task of omitting older .NET Core versions and dependencies as well.

As mentioned previously, the team has concluded that we should align with Microsoft’s recommended framework versions so that our products leverage the latest advancements in technology, security, and performance. 

To be more specific, this change is scheduled for the next 2024 Q2 release and will support applications targeting .NET 6 and above, as mentioned in our latest release notes:

Dan
Top achievements
Rank 1
commented on 17 Apr 2024, 04:32 PM

Any timeline for the Q2 release. This is really eating our lunch right now. Thanks!
Alexander
Telerik team
commented on 19 Apr 2024, 06:37 PM

Hi Dan,

The Q2 release is scheduled to come to light around the middle of May. However, once I have further confirmation regarding the exact date, I will update this thread with more information. In order to keep you guys posted - should there be any alterations.

Josh
Top achievements
Rank 1
commented on 09 May 2024, 09:00 PM | edited

Has there been any further confirmation on when this will be fixed?
Alexander
Telerik team
commented on 10 May 2024, 03:30 PM

Hi Josh,

Our release is scheduled to come into light as of the 15th of May. However, if there seems to be a change, I will make sure the keep you up to date.

Prabhat
Top achievements
Rank 1
commented on 16 May 2024, 06:56 PM | edited

Tried the new 2024 Q2. Problem seems to still exist. Release note doesn't even seem to mention this issue.

 

Alexander
Telerik team
commented on 17 May 2024, 03:20 PM

Hi Prabhat,

Could you please verify whether you are utilizing the .NET8 as a target framework? 

JeffVisibilEDI
Top achievements
Rank 1
Iron
commented on 17 May 2024, 04:11 PM

I just updated all of the Nuget packages in my project (including Telerik and all .NET, EFCore, etc.) to the latest versions. The same messages were in the build logs until I deleted the 5-6 Microsoft.CodeAnalysis packages that were needed previously. I was able to launch the application without error, but have not yet had time to do anything more than that smoke test.
Alexander
Telerik team
commented on 20 May 2024, 03:40 PM

Hi Jeffrey,

Indeed, deleting the old versions of the Microsoft library should resolve the issue. Generally, we've had an internal effort in bumping the version of the "Microsoft.CodeAnalysis" dependency as a consequence of our latest release.

Here is how the aforementioned dependency is configured depending on the aforementioned versions, so that things are more transparent:

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
  <FrameworkReference Include="Microsoft.AspNetCore.App" />
  <PackageReference Include="Microsoft.CodeAnalysis" Version="4.4.0" />
  <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
  <FrameworkReference Include="Microsoft.AspNetCore.App" />
  <PackageReference Include="Microsoft.CodeAnalysis" Version="4.4.0" />
  <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
  <FrameworkReference Include="Microsoft.AspNetCore.App" />
  <PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0" />
  <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.*" />
</ItemGroup>

Since this is an indirect dependency, there should be no restrictions from altering the version depending on your target framework.

JeffVisibilEDI
Top achievements
Rank 1
Iron
commented on 20 May 2024, 03:45 PM

Thank you, Alexander. My comment was (mostly) directed toward the author of the previous response that indicated that the problem hadn't been fixed. ;)

Thank you and the Telerik team for addressing this issue and for you responsiveness to your customer requests!

 

Alexander
Telerik team
commented on 21 May 2024, 08:04 AM


Thank you for the clarification and your insights on what exactly has been rectified the issue.

I hope the community benefits from this discussion, so I wanted to spare some time and say thank you for being so proactive during the past couple of months. Your feedback was invaluable to the case, as it helped us move forward with the dependency migrational endeavor.

Thank you again and keep up the awesomeness!

Tags
General Discussions
Asked by
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Nikolay
Top achievements
Rank 1
Iron
Alexander
Telerik team
Share this question
or