Could not load type from assembly error

前端 未结 25 1437
温柔的废话
温柔的废话 2020-11-30 03:30

I have written the following simple test in trying to learn Castle Windsor\'s Fluent Interface:

using NUnit.Framework;
using Castle.Windsor;
using System.Col         


        
25条回答
  •  半阙折子戏
    2020-11-30 04:11

    I experienced a similar issue in Visual Studio 2017 using MSTest as the testing framework. I was receiving System.TypeLoadException exceptions when running some (not all) unit tests, but those unit tests would pass when debugged. I ultimately did the following which solved the problem:

    1. Open the Local.testsettings file in the solution
    2. Go to the "Unit Test" settings
    3. Uncheck the "Use the Load Context for assemblies in the test directory." checkbox

    After taking these steps all unit tests started passing when run.

提交回复
热议问题