MSTest run fails because source assembly is not trusted

前端 未结 10 1452
谎友^
谎友^ 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:45

    After having this issue and burning hours trying to get "Unblock" to stick longer than a few minutes and/or figuring out caspol to no avail, I finally found a little tidbit via Google that the assemblies will be blocked again the next time you build or rebuild the project, since they're re-copied from their original source location. (I guess I never noticed that this happened before with references assemblies, but anyway...)

    My fix for this was the following:

    1. Copy all the needed DLLs to another spot for safe-keeping

    2. Remove the references in Visual Studio

    3. Physically delete the DLLs in the bin folder

    4. Unblock the DLLs individually in the spot where they were copied off

    5. Add the references back in Visual Studio from the holding spot

    Every subsequent build or rebuild worked fine afterward.

提交回复
热议问题