Reputation: 21
Trying to Unit Test a UWP app that has a dependency on a .winmd file. If the unit test calls a method in the app that makes a call on a class in the unmanaged dll then I get a System.TypeLoadException. I've tried referencing different .winmd files and using either MSTest framework or xunit but always get the same error. Other unit tests work fine.
Issue can be reproduced..
Any help would be great. Thanks.
Upvotes: 1
Views: 294
Reputation: 21
After further testing and help from Microsoft here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/68b9ee55-cd7a-4334-952a-a7ecfff4c6ca/unit-testing-uwp-app-that-references-unmanaged-dll-causes-systemtypeloadexception?forum=vsunittest
I have determined that the issue is relating to Resharper. If I disable Resharper and run the unit tests using MsTest Framework and in Test Explorer than the tests work normally.
I achieved this by un-toggling the Enable MSTest support checkbox in Resharper Options->Tools->Unit Testing->MsTest.
Upvotes: 1