System.TypeLoadException: 'Method 'GetItem' in type 'Microsoft.AspNetCore.Mvc.Razor.Internal.FileProviderRazorProjectFileSystem' from assembly 'Microsoft.AspNetCore.Mvc.Razor, Version=2.2.0.0, ...

Pier-Luc Allard 1 Reputation point
2022-07-04T15:53:19.577+00:00

Hi there,

Since the last Visual Studio 2022 update, I've been having the error on my application and can't seem to make it disappear for some reason.

217389-image.png

The error is pretty straight forward, it's missing a reference to Mvc.Razor version 2.2.0.0. So I've added it using NuGet, but no luck, I still get the same error. Does anyone know what's happening? Any help is appreciated, and I can provide other details if requested.

Thanks!

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,369 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,604 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pier-Luc Allard 1 Reputation point
    2022-07-05T13:14:26.373+00:00

    As an alternate solution, I've installed VS 2019 and the problem does not happen. Something is definitely up with the newest VS 2022 update. I'm using .NET Core 2.2, but even if it's not supported, it shouldn't give me additional errors.

    0 comments No comments