MSTest Looking For DLL In Wrong Location

别等时光非礼了梦想. 提交于 2019-12-09 06:33:53

问题


I have a test harness running and it was failing to run due to Type not resolved, which more specifically was a SerializationException on a bad bind.

I used fuslogvw to track down where it was looking for the DLL and not finding it and I'm confused as to why it is looking in the location it is:

=== Pre-bind state information ===
LOG: DisplayName = DavisVision.Common.Data, Version=3.1.0.34, Culture=neutral, PublicKeyToken=c410b32babd148a6
 (Fully-specified)
LOG: Appbase = file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = vstest.executionengine.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\vstest.executionengine.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: DavisVision.Common.Data, Version=3.1.0.34, Culture=neutral, PublicKeyToken=c410b32babd148a6
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/DavisVision.Common.Data.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/DavisVision.Common.Data/DavisVision.Common.Data.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/DavisVision.Common.Data.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/DavisVision.Common.Data/DavisVision.Common.Data.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/DavisVision.Common.Data.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/DavisVision.Common.Data/DavisVision.Common.Data.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/DavisVision.Common.Data.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/DavisVision.Common.Data/DavisVision.Common.Data.EXE.
LOG: All probing URLs attempted and failed.

If I put the DLL in that folder it obviously loads fine, but shouldn't it be loading from the bin directory of the test project, how can I get MSTest to load the right DLL from the bin folder?

This only happens in this test harness as well, all the projects are able to bind to this DLL normally and without issue.

Notes: -Not sure if this impacts anything but this is an internal NuGet package which is being referenced in the test harness, but the DLL is being pulled and put in the test harness' bin/ folder.

来源:https://stackoverflow.com/questions/33045685/mstest-looking-for-dll-in-wrong-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!