Unit test project cannot find assembly under test (or dependencies)

前端 未结 10 1823
刺人心
刺人心 2021-01-02 00:31

When I try to run my Unit Test project, I get the following error:

Could not load file or assembly \'ASSEMBLY_NAME, Version=1.0.0.0, Culture=neutral, Pub

相关标签:
10条回答
  • 2021-01-02 01:24

    I tried all above to no avail. Finally, in the csproj i changed

    <Private>False</Private>
    

    to

    <Private>True</Private>
    

    on the references and all tests passed.

    0 讨论(0)
  • 2021-01-02 01:24

    Maybe enabling assembly loading logging can give you a hint about why your assembly cannot be loaded.

    http://msdn.microsoft.com/en-us/library/e74a18c4.aspx

    0 讨论(0)
  • 2021-01-02 01:25

    I had the same issue and found that copying the dll's to the GAC resolved the issue. Though I still don't understand why it doesn't use the referenced projects assemblies.

    0 讨论(0)
  • 2021-01-02 01:32

    Check Build->Configuration Manager... menu. All projects should have the same platform and column Build checked.

    Also you can take a look into output of the build (Output window), it usually states more clearly which file could not be found.

    0 讨论(0)
提交回复
热议问题