Could not load type 'Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ExpressionMetadataProvider' from assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures, Version=6.0.0.0,

-------- george------- 0 Reputation points
2023-04-27T21:53:53.4266667+00:00

when I upgraded net core2.1 to net 6 , I have error

"TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ExpressionMetadataProvider' from assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.",

I use Kendo library for grids and dropdowns, please help me if you have any solution

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,553 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,913 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vahid Ghafarpour 21,240 Reputation points
    2023-04-28T03:02:20.95+00:00

    The TypeLoadException you're seeing may be caused by a version mismatch between the Microsoft.AspNetCore.Mvc.ViewFeatures assembly and the Kendo library that you're using.

    To resolve this issue, you can try the following steps:

    Make sure that you have the latest version of the Kendo library that's compatible with .NET 6. You can check the Kendo UI for ASP.NET Core version history page to see which version supports .NET 6.

    Check if there are any updates available for the Microsoft.AspNetCore.Mvc.ViewFeatures package. You can do this by opening your project in Visual Studio and navigating to the NuGet Package Manager. From there, you can search for Microsoft.AspNetCore.Mvc.ViewFeatures and check if there are any available updates.

    If updating the packages doesn't solve the issue, you can try cleaning and rebuilding your solution. In Visual Studio, you can do this by selecting "Clean Solution" from the "Build" menu, and then selecting "Rebuild Solution" from the same menu.

    If the issue still persists, you can try removing the Kendo library from your project and then re-installing it. To do this, you can open your project in Visual Studio, navigate to the NuGet Package Manager, and then uninstall the Kendo library. After that, you can re-install the latest version of the library that's compatible with .NET 6.

    0 comments No comments

  2. Vahid Ghafarpour 21,240 Reputation points
    2023-04-28T03:02:34.55+00:00

    The TypeLoadException you're seeing may be caused by a version mismatch between the Microsoft.AspNetCore.Mvc.ViewFeatures assembly and the Kendo library that you're using.

    To resolve this issue, you can try the following steps:

    Make sure that you have the latest version of the Kendo library that's compatible with .NET 6. You can check the Kendo UI for ASP.NET Core version history page to see which version supports .NET 6.

    Check if there are any updates available for the Microsoft.AspNetCore.Mvc.ViewFeatures package. You can do this by opening your project in Visual Studio and navigating to the NuGet Package Manager. From there, you can search for Microsoft.AspNetCore.Mvc.ViewFeatures and check if there are any available updates.

    If updating the packages doesn't solve the issue, you can try cleaning and rebuilding your solution. In Visual Studio, you can do this by selecting "Clean Solution" from the "Build" menu, and then selecting "Rebuild Solution" from the same menu.

    If the issue still persists, you can try removing the Kendo library from your project and then re-installing it. To do this, you can open your project in Visual Studio, navigate to the NuGet Package Manager, and then uninstall the Kendo library. After that, you can re-install the latest version of the library that's compatible with .NET 6.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.