Install MSTest in Teamcity 9 - teamcity

So, I've just installed Teamcity 9.1 (latest version, today) on a Windows server 2012. Before that I installed VS2015. I want to run MSTest after compilation as a separate build step. However, it doesn't show up in the list (dropdown). I only see Nunit et.c. How do I get MSTest to be one of the test runners? Do I need to install something separately? According to the docs it should be a built-in feature. Am I missing something? Any help is appreciated.

If you are using 9.1+ the runner is now called Visual Studio Tests
Hope this helps

Related

Visual Studio 2019 - Unable to debug Azure functions - (Desktop CLR (.NETFramework) versus Managed (CoreCLR)' debugger

I have installed the Visual Studio 2019 community version 16.4.4 on a brand new laptop
OS:- Windows 10 Home Single Language
The following are the .NET Core SDKS installed in my laptop
The command dotnet --info gave me the following details
I created a Azure function with V3 template
The project settings are given below
When I try to debug , i get the following error
A fatal error has occurred and debugging needs to be terminated. The debugger was configured to use the Desktop CLR (.NETFramework) Managed debugger, but the target process loaded the CoreCLR (.Net Core) runtime. To debug this project, configure it to use the 'Managed (CoreCLR)' debugger."
Tried several options like the one mentioned in the link below
https://social.msdn.microsoft.com/Forums/en-US/59f880f7-ed60-4842-bc55-a9400971c58b/problem-debugging-net-core?forum=vsdebug
EDIT: This has been fixed in the latest release of Visual Studio v16.4.5
The problem seems to be a mismatch in the version of the Azure Functions CLI. As a workaround, you can do this:
Install the latest Azure Functions CLI, from the command line run:
npm i -g azure-functions-core-tools#3 --unsafe-perm true
or if you are using Chocolatey:
choco install azure-functions-core-tools
Restart Visual Studio.
I still have this issue after reinstalling my VS2019, downloading the latest sdk and downloading the core tools multiple times. Seems like the only way for now is to run without using the debugger (Ctrl + F5). Sometimes I downgrade the function to v2.1 for this only happens on v3 functions.
Edit: I got this fixed when I updated my VS to 16.5.1
It looks like one similar issue which has been reported to DC forum. However it works well in my side with same 16.4.4 version. Since I didn't reproduce same issue, I can't provide a direct answer.
Here're some possible workarounds which may help:
Repair VS and go Tools=>Import and Export Settings=>Reset all settings=>No,just reset, overwrite... (Since my same version works well)
Hint from this one, you may backup the launchsettings.json in project and then delete it, rebuild and debug(F5) it again.
And if the issue persists, you can try installing .net core 3.0 sdk and recreate a new project to check if it helps.(I have both .net core 3.0 and 3.1 installed, but by default it picks .net core 3.0 when I create the project, not sure if it makes any difference.)
Hope it helps :)
Update:
Sorry for not noticing that the solution will not work for you. Since the solution doesn't work, you can choose another way. As the error says, you need to
configure it to use the 'Managed (CoreCLR)' debugger."
So, try to configure on hand, Select 'Debug' above the VS 2019 tab, then
Original Answer:
I faced exactly the same error before and solved it with below solution, it works well.
Solution:
Just enable the native code debuging.
Right click your project > properties > Debug. Tick ​​'enable the native code debugging' like this:
I have the same issue, I have upgraded visual studio 2019 to 16.4.4 and it resolved my issue. that was the bug by visual studio 2019 in 16.3 versions. please upgrade visual studio. it will definitely resolve your issue.
Issue was resolved with the next upgrade of Visual Studio 2019
Trying Install the v3.x Core Tools package from the command line run npm install -g azure-functions-core-tools#3.
Reference: Use npm to install Core Tools on Windows

Using Microsoft.NET.Sdk.Web without Visual Studio?

I am trying to build a dotnet core web app on a build server that has MsBuild, but not Visual Studio, installed. I cannot get around the message error MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.
The command dotnet --info shows Microsoft.NETCore.App 3.1.0 installed, just as on my development machine where the project builds. The contents of C:\Program Files\dotnet\sdk\3.1.100 appear to match between the two machines. Global.json points to the 3.1.0 version.
Is Microsoft.NET.Sdk.Web a separately-installed thing? I see what look like separate packages, now deprecated, on NuGet, and I'm guessing this is now baked into the base .NET SDK?
Where should I be looking for differences to try to find the missing pieces?
Solved the problem by (1) running vs-buildtools installer to put some additional pieces in place, and (2) adding some NuGet packages for web component.

NUnit tests not list in Test Explorer with Nunit Test Adapter is installed

I am using vs 2013 pro.
I've installed NUnit and NUnit Test Adapter for VS2012, 2013, 2015.
I find there is no tests show up in Test Explorer. I rebuilt the solution, I restarted the computer, no help. I set platform targets for the main project and the test project to use any CPU, no help, set to x86, no help too.
Please help me. Thank you.
I had similar problem after installed NUnit.3.2.1.msi and NUnit3 TestAdapter as extension in VisualStudio 2015. In case it helps you to see the tests at least in one way, here is what I did: Although there was no tests visible in Test Explorer, I
1) pushed Run All,
2) saw an error text in the
status bar, in the bottom of Visual Studio window.
3) checked - as it instructed - the Output pane for Tests (Where is the 'tests output pane'?). In my case, it complained about exception in discovering tests, not supporting the portable version of NUnit and suggested using a platform specific runner.
4) tried out a solution to solve my error: I uninstalled the NUnit msi, in case it was the portable version not supported.
In VisualStudio, with my project open, I retrieved via NuGet Packgage Manager the NUnit 3.2.1 (April 19, 2016), NUnit Runners 3.2.1 (April 19, 2016), and NUnitTestAdapter 2.0 (April 2,2015). I think retrieving the NUnit Runners was the cure.
Additionally, I also removed from References Microsofts test library which had appeared there during trials. However, I don't believe it had any effect.
Your error description may be different, and may require a different solution.
I had same problem in VS2015. I solved it by downgrading NUnit to version 2.6.4. Latest 3.5.0 version appeared to be incompatible with latest NUnitTestAdapter 2.0.0. Seems it refers only to VS 2015, earlier version should be fine.

No code coverage for .NET Projects when MSBuild SonarQube Runner is used

We are using sonarqube 5.1.1 version and faced issues while analyzing .NET projects using sonar-runner.
As the recent update says, sonar-runner does not support .NET projects anymore, we have installed MSBuild.SonarQube.Runner-1.0 to analyze the same.
We are able to create dashboards for the .NET projects now but unit test cases and unit test coverage is missing.
Could you kindly help us here?
Please note that we have enterprise license and all the existing .NET projects in production environment use Visual studio 2010.
I have upgraded the dev instance to check the feasibility.

TeamCity Warning: No enabled compatible agents for this build configurationn

I'm trying to set up continuous integration at my current place of work. It's not something I've done before so I'm fairly certain that there will be a few steps I've not done or things I'm un-aware of.
I installed TeamCity Professional 7.1.3 on a build server (Windows Server 2008 R2). I've created a simple .NET application that has no database connections and only three NUnit tests. This app uses .NET framework 4.
I set up a build step using NUnit and received a number of errors but I've now resolved them, basically by installing the .NET framework on the build server.
I'm now adding an extra step using Visual Studio but TeamCity now displays the warning 'No enabled compatible agents for this build configuration'.
This question looks similar to mine:
What do I need to install a Visual Studio 2010 (sln)-compatible Build Agent in TeamCity? and it helped me solve the problems I had with NUnit but not for this current problem.
Is there something I've missed during my set-up? If I'm building and running tests with NUnit do I need to bother with this second step?
You installed the full framework, correct -- not just the client pieces? Here's a TeamCity forum post on how to resolve the Unmet requirements:DotNetFramework4.0_x86 exists compatibility error when you've previously installed the framework.

Resources