How to debug System.TypeLoadException errors in .NET?

后端 未结 7 2034
走了就别回头了
走了就别回头了 2020-12-03 10:07

I\'m getting the following error on one of my referenced assemblies:

Could not load type \'System.Func`2\' from assembly \'MyAssembly, ...

I\'ll

7条回答
  •  甜味超标
    2020-12-03 10:32

    This problem may occur if you have different versions of NuGet packages installed across different projects. To identify these cases,

    1. Right-click the solution in Solution Explorer and select "Manage Nuget Packages for Solution"
    2. Select the "Consolidate" tab
    3. For any identified packages, identify the version you want and click "Install" to consolidate the package to that version.

提交回复
热议问题