MSTest run fails because source assembly is not trusted

前端 未结 10 1479
谎友^
谎友^ 2020-12-23 11:18

I just added xUnit to our test project (for the Asserts, we\'re still using MSTest as the framework) and immediately the test runs refused to execute any of the tests. This

10条回答
  •  臣服心动
    2020-12-23 11:57

    It took me a few tries to find the answer in Google, so I'm putting it here in case anyone else runs into the same problem. A detailed description can be found at this blog posting.

    Basically, the fix invovles right-clicking on the dll file (xunit.dll for example) in Windows Explorer, going to Properties, and clicking "Unblock" at the bottom of the tab next to the 'Security' text. It seems that Vista / Windows 2008 will automatically mark assemblies that come from other machines or the internet as unsafe.

    As a couple commenters have mentioned, you may also need to restart Visual Studio for this to take effect.

提交回复
热议问题