Answered by:
Mstest - does not load the test dll if UNC path is referenced in the testcontainer

Question
-
When I ran a automated test from the MS Test Manager, it failed with the below message.
"Error adding test case [123] to test run: Could not load file or assembly 'file://\localhost\TFS\OGUI\OGUI_20111228.8\catsprojects.dll' or one of its dependencies. The system cannot find the file specified."
Also when I ran the recorded test using MsTest with local reference, the dll loaded and the playback was done.and the test ran successfuly.
eg. mstest /testcontainer:D:\TFS\OGUI\OGUI_20111228.8\CATSProjects.dll
But with UNC Path, the dll was not loaded and it showed the below error.
mstest /testcontainer:"\200411dc0310\TFS\OGUI\OGUI_20111228.8\CATSProjects.dll"
Could not load file or assembly 'file://\200411dc0310\TFS\OGUI\OGUI_20111228.8\CATSProjects.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
How do we fix this and run the tests referencing the UNC path?
Any help is greatly appreciated.
Thanks
Mush
Wednesday, January 4, 2012 9:16 AM
Answers
-
Hi, you could use the xcopy command to copy the files before running the tests http://www.computerhope.com/xcopyhlp.htm
Thanks,
Anuj
http://www.anujchaudhary.com- Marked as answer by Gautam Goenka [MSFT] Monday, January 9, 2012 1:08 PM
Thursday, January 5, 2012 3:33 AM
All replies
-
HiWhen I ran a automated test from the MS Test Manager, it failed with the below message."Error adding test case [123] to test run: Could not load file or assembly 'file://\localhost\TFS\OGUI\OGUI_20111228.8\catsprojects.dll' or one of its dependencies. The system cannot find the file specified."Also when I ran the recorded test using MsTest it failedmstest /testcontainer:\200411dc0310\TFS\OGUI\OGUI_20111228.8\CATSProjects.dllCould not load file or assembly 'file://\200411dc0310\TFS\OGUI\OGUI_20111228.8\CATSProjects.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)MSTest loaded the dll and played back only if the dll location is referenced with the "local path" instead of "shared path."mstest /testcontainer:D:\TFS\OGUI\OGUI_20111228.8\CATSProjects.dllBut with UNC Path, the dll was not loaded and it showed the above error.How do we fix this in both MTM and MStest? Please help.ThanksMush
- Edited by Mustaque PLR Wednesday, January 4, 2012 1:23 PM
- Moved by Jack Zhai-MSFTMicrosoft contingent staff Friday, January 6, 2012 6:18 AM It's related to MTM. (From:Visual Studio UI Automation Testing (includes CodedUI))
- Moved by Gautam Goenka [MSFT] Monday, January 9, 2012 1:09 PM (From:Testing with Visual Studio Test Manager (MTM))
- Merged by Jack Zhai-MSFTMicrosoft contingent staff Tuesday, January 10, 2012 8:40 AM The same issue.
Wednesday, January 4, 2012 1:22 PM -
Hi, you could use the xcopy command to copy the files before running the tests http://www.computerhope.com/xcopyhlp.htm
Thanks,
Anuj
http://www.anujchaudhary.com- Marked as answer by Gautam Goenka [MSFT] Monday, January 9, 2012 1:08 PM
Thursday, January 5, 2012 3:33 AM -
That will work with MSTest but how to fix in MTM where we associate the test plan with a Build (output of which is stored in UNC Path).
Whether MStest supports dll referenced in a share folder ?
MushThursday, January 5, 2012 9:22 AM -
Hi, for the MTM scenario, the test agent copies the files locally from the build drop into %localappdata%\VSEQTand it works well.
Thanks,
Anuj
http://www.anujchaudhary.comThursday, January 5, 2012 4:31 PM -
Hi Mush,
I am moving your thread into the Testing with Visual Studio Test Manager (MTM) Forum for dedicated support. Thanks for your understanding.
Have a nice day,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Friday, January 6, 2012 6:17 AM -
Hi,
UNC path wont work. You can copy the dll locally using xcopy command and then run the tests using mstest command.
Thanks,
Anuj
http://www.anujchaudhary.comTuesday, January 10, 2012 2:18 AM -
For another resolution also refer to http://clearmindsoftware.com/post/Resolution-Error-Could-not-load-file-or-assembly-file5c5cserver5cpath5cfiledll-or-one-of-its-dependencies-(0x80131515).aspx.
Thanks,
Clementino de Mendonça ALM Ranger
- Proposed as answer by Clementino de Mendonça Thursday, October 30, 2014 8:09 PM
Thursday, October 30, 2014 8:08 PM