I am using the windows-2019 agent with this step:
- task: VSTest@2
displayName: Run UnitTests
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**/Release/x64/UnitTests.build.appxrecipe
searchFolder: '$(Pipeline.Workspace)'
in the log, I can see it's launching the test with something like this:
vstest.console.exe "D:\a\1\drop\Release\x64\UnitTests.build.appxrecipe"
Next, it fails with this error:
[error]Failed to launch testhost with error: System.AggregateException: One or more errors occurred. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\a\1\s\drop\Release\x64\ilc\AppxManifest.xml'. ##[debug]Processed: ##vso[task.logissue type=error;]Failed to launch testhost with error: System.AggregateException: One or more errors occurred.
I am not sure why it is happening, because, in my local machine, I can run vstest.console.exe against the appxreceipt that is built from my local environment.
I do not have the ilc subfolder locally. The AppxManifest.xml is actually in the same folder as the appxrecipe file, why is Azure DevOps looking for it in a subfolder?
The unit test runs and passes locally, but just can't run in azure DevOps. Does anyone know about this error message?
Update
Later I copied from another folder, so now the test run folder has an ilc subfolder with the AppxManifest.xml. I printed the entire directory tree and I can see the file.
Unfortunately, I am still seeing the error:
2021-01-04T18:02:16.4168648Z ##[error]Failed to launch testhost with error: System.AggregateException: One or more errors occurred. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\a\1\s\drop\Release\x86\UnitTests\ilc\AppxManifest.xml'.
2021-01-04T18:02:16.4171040Z ##[debug]Processed: ##vso[task.logissue type=error;]Failed to launch testhost with error: System.AggregateException: One or more errors occurred. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\a\1\s\drop\Release\x86\UnitTests\ilc\AppxManifest.xml'.
2021-01-04T18:02:16.4179397Z ##[error] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
2021-01-04T18:02:16.4180905Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
2021-01-04T18:02:16.4183043Z ##[error] at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
2021-01-04T18:02:16.4184829Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
2021-01-04T18:02:16.4187337Z ##[error] at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
2021-01-04T18:02:16.4188735Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
2021-01-04T18:02:16.4191848Z ##[error] at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
2021-01-04T18:02:16.4193331Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
2021-01-04T18:02:16.4199669Z ##[error] at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
2021-01-04T18:02:16.4201095Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
2021-01-04T18:02:16.4203263Z ##[error] at System.Xml.XmlTextReaderImpl.FinishInitUriString()
2021-01-04T18:02:16.4204425Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Xml.XmlTextReaderImpl.FinishInitUriString()
2021-01-04T18:02:16.4212719Z ##[error] at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
2021-01-04T18:02:16.4214161Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
2021-01-04T18:02:16.4219038Z ##[error] at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
2021-01-04T18:02:16.4220367Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
2021-01-04T18:02:16.4223912Z ##[error] at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
2021-01-04T18:02:16.4225961Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
2021-01-04T18:02:16.4227028Z ##[error] at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
2021-01-04T18:02:16.4228461Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
2021-01-04T18:02:16.4229380Z ##[error] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.AppxManifestFile.ReadTargetPlatformVersions()
2021-01-04T18:02:16.4230291Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.AppxManifestFile.ReadTargetPlatformVersions()
2021-01-04T18:02:16.4231242Z ##[error] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.AppxManifestFile.get_TargetPlatformVersion()
2021-01-04T18:02:16.4232033Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.AppxManifestFile.get_TargetPlatformVersion()
2021-01-04T18:02:16.4232939Z ##[error] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.RecipeFile.get_TargetPlatformVersion()
2021-01-04T18:02:16.4233716Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.RecipeFile.get_TargetPlatformVersion()
2021-01-04T18:02:16.4234953Z ##[error] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.Deployer.Microsoft.VisualStudio.UwpTestHostRuntimeProvider.IDeployer.get_TargetPlatformVersion()
2021-01-04T18:02:16.4235974Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.Deployer.Microsoft.VisualStudio.UwpTestHostRuntimeProvider.IDeployer.get_TargetPlatformVersion()
2021-01-04T18:02:16.4236919Z ##[error] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<LaunchHostAsync>d__38.MoveNext()
2021-01-04T18:02:16.4237698Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<LaunchHostAsync>d__38.MoveNext()
2021-01-04T18:02:16.4238493Z ##[error]--- End of stack trace from previous location where exception was thrown ---
2021-01-04T18:02:16.4239155Z ##[debug]Processed: ##vso[task.logissue type=error;]--- End of stack trace from previous location where exception was thrown ---
2021-01-04T18:02:16.4239936Z ##[error] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
2021-01-04T18:02:16.4240675Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
2021-01-04T18:02:16.4241737Z ##[error] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2021-01-04T18:02:16.4242520Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2021-01-04T18:02:16.4243715Z ##[error] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<Microsoft-VisualStudio-TestPlatform-ObjectModel-Host-ITestRuntimeProvider-LaunchTestHostAsync>d__30.MoveNext()
2021-01-04T18:02:16.4244732Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<Microsoft-VisualStudio-TestPlatform-ObjectModel-Host-ITestRuntimeProvider-LaunchTestHostAsync>d__30.MoveNext()
Does anyone know about this error message?