CI Build Error with Visual Studio Test step after .Net 4.6 upgrade - Executor process exited; There was no endpoint listening at net.pipe - azure-devops

I just upgraded all of the projects in my solution to point to .Net 4.6 (There is a web app, some class libraries, a database project, etc.). I have a CI build set up in Visual Studio Team Services (using the new build system, not XAML) which was building successfully prior to the upgrade. This build definition runs Debug, Staging, and Production builds and the build definition is comprised of two steps:
Visual Studio Build
Visual Studio Test
Prior to this framework upgrade, everything was building fine. I upgraded and built everything locally and it all worked great too. I could run the tests and got green across the board. Now, when I checked my code in it kicked off the CI build, and I got the following error/s on the "Visual Studio Test" step (taken from the logs):
2015-09-18T19:08:02.1212067Z Microsoft (R) Test Execution Command Line Tool Version 14.0.23107.0
2015-09-18T19:08:02.1489666Z Copyright (c) Microsoft Corporation. All rights reserved.
2015-09-18T19:08:02.8906952Z Starting test execution, please wait...
2015-09-18T19:08:03.3713251Z Warning: Using Isolation mode to run tests as required by effective Platform:X86 and .Net Framework:Framework35 settings for test run. Use the /inIsolation parameter to suppress this warning.
2015-09-18T19:08:07.4457804Z ##[error]Error: Executor process exited.
2015-09-18T19:08:07.4457804Z ##[error]
2015-09-18T19:08:07.4557251Z ##[error]Error: There was no endpoint listening at net.pipe:[...redacted...] that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
2015-09-18T19:08:07.4557251Z ##[error]
2015-09-18T19:08:07.7730938Z ##[error]VSTest Test Run failed with exit code: 1
2015-09-18T19:08:07.8043435Z ##[warning]No results found to publish.
The Visual Studio Build passes for all three configurations, and the Test step only fails for Debug because it cannot find any tests for the other two configurations. Additionally, my builds are running off of an Azure VM that I stood up to act as a build server, and when I run the CI build using the Hosted build controller the Test step passes, because it cannot find any tests to execute, but the warning about using 'Isolation mode to run tests...' is still printed out in the log.
Is this a known issue? Has anyone else encountered this after a 4.6 upgrade or in another context in VSTS?
Edit: the .Net Framework 4.6 SDK and targeting pack/s ARE installed on the build machine:

The first warning suggests that the tests are running on .NET 3.5:Warning: ... effective Platform:X86 and .Net Framework:Framework35 ...
So I explicitly set the vstest.console framework version to 4.5. (At this time 4.6 is not an available option). That resolved these symptoms for me.
To do so edit the Visual Studio Test build step. On the Build tab of the step settings, expand the Advanced section, and set Other console options to /Framework:Framework45.

I found a workaround for the time being that works for now. I modified the settings for the Visual Studio Test build step as follows:
On the Build tab of the step settings, expand the "Advanced" section, and change the VSTest version to "Visual Studio 2013".
That's all it took for me. I tried this because my build was working when I switched to the Hosted build controller, and this was one of the differences between the two in the logs. This is the only thing that I changed, and it worked. I have no idea WHY the Visual Studio 2015 VSTest version doesn't work, but will look into it more and add to this if I find anything...

I experienced this error (specifically the VSTest exit code) after upgrading a test project to 4.6.1. The issue was that the packages.config didn't update the test framework runner pacakge correctly leaving it at .Net 3.5. Updating the target framework resolved the problem.

After installing .Net Framework 3.5 feature everything was OK! See "cottsay" comment at https://github.com/Microsoft/vsts-tasks/issues/572

Related

Xamarin Android AOT Compilation Availability in AzureDevOps

The documentation around the AOT compilation feature of Xamarin Android states that it is only available when using Enterprise additions of Visual Studio. What does this means for AzureDevops build pipelines if the feature is enabled?
Presumably the build agents don't use an Enterprise addition of the Visual Studio build tools so does this mean a build produced via AzureDevops cannot have the AOT feature enabled? If this is true the feature seems of limited use when using AzureDevops as you won't be able to have it enabled for release builds coming from your build pipelines.
The Build Agent "Windows latest" does have VS 2019 Enterprise installed. See here for a link to the List with all included software.
In addition, last time I tried that out I had to manually install the Android NDK. I used a command line step with this:
C:\"Program Files (x86)"\Android\android-sdk\tools\bin\sdkmanager "ndk-bundle"
Although it might well be that this changed meanwhile since it is listed in the included software.

Azure Pipelines - Visual Studio Test does not publish results from TestContext.WriteLine

We are using Azure DevOps to run a build that runs tests using Visual Studio Test.
Everything is working fine, Console.WriteLine lines are being written to Standard Console Output.log, however TestContext.WriteLine are not appearing in the Detailed report.
The same lines are indeed appearing in the Output link on Test Explorer in Visual Studio.
Environment Information
Build Solution: Visual Studio 2017`
VSTest: Latest
Test Framework: MSTest.TestFramework 1.3.2
Test Adapter: MSTest.TestAdapter 1.3.2
Just to reiterate, TestContext is being instantiated correctly, and we are able to check the Output on local machine (Visual Studio 2015 Update 3), however the Ouput will not be published to Azure Pipelines build
Thank you,
Regards

I can't get Nuget push command to work on Visual Studio Online using latest Nuget tasks

I am using Visual Studio 2017 and Visual Studio Online. My team has recently switched to Asp.Net core 1.1 for our web development. Before we had a working nuget publishing process, but that doesn't work anymore because the old nuget tasks are deprecated.
I'm already aware that there should be Nuget package task before the push task, but that task has a known bug for .Net core. Instead I set up my project in VS so that the build task generates my .nupkg file.
Here is my setup from vs-online:
My setup for Nuget push task
The result looks like this:
The result when running.
I solved my problem myself.
I changed the path to:
**/*.nupkg;-:**/packages/**/*.nupkg;-:**/*.symbols.nupkg

Solution contains both NUnit 2 and NUnit 3 tests, I get UnsupportedFrameworkException in the TFS Build

In my solution there are several projects, some are using NUnit 2 and some are using NUnit 3.
They have the relevant test adapters and versions installed via NuGet.
When my TFS build runs, I get the error:
Error: Exception NUnit.Core.UnsupportedFrameworkException, Exception
thrown executing tests in
E:\BuildAgents\Agent1_work\9\s\Kittens_Local\Kitten\kitten\kitten\Kitten.Fluffy.Tests\bin\Debug\Kitten.Fluffy.Tests.dll
This project is using version 3 while the other tests are using version 2.
Is it possible to get both working simultaneously in TFS?
This seems to be a issue in Nunit2 adapter(Nunit TestAdapter Nuget Package). So you could not get both working simultaneously in TFS. More details please refer Charlie's answer in this question: nunit tests throwing exception only when run as part of tfs msbuild process
If you have both adapters installed, each one will run the tests for
which they are designed. Each of them will display a message in for
any assembly that they do not support. The message isn't meant to be
an error and we try to word it in such a way that it won't be taken as
such. However, we felt we have to give it just in case you expected
the assembly to be handled by that particular adapter. Passing it by
silently seems wrong.
When running under the VS IDE, the message does not cause a failure in
the test run. It appears that running under TFS does cause a failure.
If memory serves, we fixed this problem for the NUnit 3 adapter but
not (yet) for the NUnit 2 adapter.

What steps should I take to troubleshoot a testdriven.net installation?

I'm trying to get up and running with nUnit, which has been pretty painful so far. I have successfully installed and added a reference to the nUnit framework, and I've successfully created a simple test--but get this error when I try to use the nUnit GUI:
C# .NET 4.0 Testing Framework?
On the advice of that post, I'm now trying to run nUnit from inside VS2010 with testdriven.net. I successfully installed testdriven.net, but when I re-start visual studio, I simply don't see the context menus described in the testdriven.net quickstart. How do I know if testdriven.net even installed correctly? What can I do to get up set up with testdriven.net or nUnit?
If you wanna check if it's installed, go to: Tools->Add in Manager, you should see it listed there.
If it's not there, then it is not installed, try the following:
try uninstalling from control panel 'TestDriven.Net 3.0 Personal', restart, then install again while visual studio is closed
make sure you download the RTM not the beta version, right click and unblock the zip file, install as admin.