I have a ASP.NET Core Web API / .NET Core application running that builds and executes tests locally and on other developer machines. It also runs fine in Docker (we build/test application prior to building docker). We are trying to automate our builds using Visual Studio Team Services and the solution builds fine, it is when it executes the tests on VSTS there is an issue. The application is loading assemblies at run time that it reads from the configuration file, thus when the application tries to load the assembly, it throws an exception (below) saying it cannot be found. The values in the configuration file are relative paths. Anything obvious that I am missing
System.Exception with message "Unable to load assembly or type. A: R:\agent\_work\4\s\Support\<assemblyname>, T: <TypeName>. Error: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
When the application runs from Visual Studio, it runs fine. When I run the below command, I can recreate the error we get on VSTS.
"C:\Program Files\dotnet\dotnet.exe" test <Project Directory>/project.json --configuration release
Any help determining the proper way to reference these files would be much appreciated.
UPDATE 2/22/17 I am still unable to run the build from VSTS. When I run the command "dotnet.exe test" from a command line that is sourced at the folder of the Test Project, I am able to run the projects.
When I change the path to exclude the ".", I still have the error locally and on VSTS. I have updated the project to reflect this. Below are my build definition:
2017-02-22T17:32:01.3057263Z Unable to load assembly or type. A: D:\a\1\s\Support\ImplAssembly.dll, T: ImplAssembly.TestReference. Error: The system cannot find the path specified. (Exception from HRESULT: 0x80070003) Running the reference with no dot
2017-02-22T17:32:01.3057263Z Getting Configuration
2017-02-22T17:32:01.3057263Z Creating implementation via assembly
2017-02-22T17:32:01.3057263Z Unable to load assembly or type. A: D:\Support\ImplAssembly.dll, T: ImplAssembly.TestReference. Error: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
Git Repo has been updated
User contributions licensed under CC BY-SA 3.0