Visual Studio Unit tests fail when running a test without a debugger

My unit tests fail when they are here:

var y = AppDomain.CurrentDomain
                 .GetAssemblies()
                 .Where(a => !a.GlobalAssemblyCache)
                 .SelectMany(a => a.GetExportedTypes()
                                   .Where(t => t.IsClass && typeof(ITypeRenderer).IsAssignableFrom(t)))
                 .ToArray();

But when I run the test with the debugger attached, it does not interrupt.

I assume that he should do something with permission permissions and all this jazz, any idea?

The exception is:

The initialization method MyUnitTestProject.UnitTest.Init threw an exception. System.NotSupportedException: System.NotSupportedException: the called item is not supported in the dynamic assembly.

An exception occurs when:

System.Reflection.Emit.InternalAssemblyBuilder.GetExportedTypes()

Thank.

+3
source share
1 answer

, : " ". , , - AppDomain, .

() , IsDynamic ( , GAC), .

+3

All Articles