How to debug System.TypeLoadException errors in .NET?

后端 未结 7 2025
走了就别回头了
走了就别回头了 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:28

    I got this error when I moved a class from one project to another in a cleanup effort. After looking at all other possible reasons, reloaded each of the projects in my solution and everything worked.

    1. Right Click on the project name in solution explorer
    2. Select Unload Project
    3. Right Click on the project name in solution explorer
    4. Select Reload Project

提交回复
热议问题