Test Explorer is finding tests, but not running them after upgrading to NUnit3TestAdapter v4.3.0 - visual-studio-2019

I'm running Visual Studio Professional 2019 and have many NUnit tests in my project. A few days ago, I updated my NUnitTestAdapter nuget package from 4.2.1 to 4.3.0 and now my Test Explorer does not run any of the tests. It throws no errors and has no problem finding/displaying the tests, but whenever I try to run them, it says:
Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 172.1 ms
I can confirm that rolling back to 4.2.1, cleaning, and rebuilding the project fixes the problem so maybe the issue is a bug in the 4.3.0 package, however I wanted to check if anyone else has this problem or if there is any configuration I need to do in Visual Studio to fix this.

This issue (.Net Framework (4.8 and lower) would crash due to InternalTracelog files trying to be written to the Program Files directory.) was fixed in version 4.3.1 of NUnit3TestAdapter Nuget package.

Related

MS Visual Studio 2019 - CRASH when Adding a new Scaffolding item

I'm trying to build an ASP.NET Core Web application .NET Core 3.1.
I run MS Visual Studio 2019, latest build.
I created the "Controllers" folder, an error occurs when trying to add Controller:
Error: there was an error running the selected code generator package restore failed
API Controller empty.
To resolve the issue, I tried the following to no avail:
Delete folders .vs, bin, obj
Clean and Rebuild project
Clear all NuGet caches
Restart, reboot
For what I can find it seems related to:
Error NU1202. Package Microsoft.AspNetCore.Razor 2.2.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.AspNetCore.Razor 2.2.0 does not support any target frameworks.
How can I solve the problem?
Resolved installing latest Visual Studio updates

Visual Studio 2019 Test Explorer puts all tests under "Not Run Tests"

I have a ASP.Net Core 3 project with Visual Studio Professional 19.4.1 with xUnit 2.4.0. I have a couple of tests written there. My problem is that Visual Studio shows all the tests in this project always under "Not Run Tests". The same tests run well with command line (dotnet test) or another computer.
Repairing/Reinstalling Visual Studio did not help.
Any help is much needed!
UPDATE: I also realized that extension DotNet Extensions for Test Explorer is not present on this computer. This is present on other computer where these work. The problem, however, is how and where to get this extension from?
I already have xunit.runner.visualstudio 2.4.0 included in the project.
Any help is much valuable!!!
Upgrade the nuget package Microsoft.NET.Test.Sdk to version 16.4.0 (or newer).
When creating a new xunit project in vs2019, the version of Microsoft.NET.Test.Sdk installed is 16.2.0, which xunit.runner.visualstudio (v2.4.0 or newer) doesn't seem to work in.
Okay, got the same error where it simply did not run any of my tests despite obviously knowing about them (visible in test explorer in Test > Test Explorer). When I pressed Run or Run all tests, it just categorized them all as "not run". To fix this I lowered my .Net Core Target framework from 3.1 to 3.0 and that fixed it for me after a clean, rebuild of the unit test project.
This error may occur if you have cloned from a repository that used a different framework.
Installing both xunit.runner.visualstudio and xunit.runner.console worked for me.

"The build task could not find node.exe which is required to run the TypeScript compiler." occurred after update Boostrap

I developed an ASP.Net MVC web application and It's almost completed. After That, I updated Bootstrap through NuGet package manager to Bootstrap latest stable version 4.3.1 Update was successfully completed. But after the migration following errors are occurred.
Error Build:Cannot find name 'Record'.
Error Build:Cannot find name 'undefined'.
To solve that I installed TypeScript for Visual Studio 2015. Then the above error solved and the following error occurred.
Severity Code Description Project File Line Suppression State
Error The build task could not find node.exe which is required to run
the TypeScript compiler. Please install Node and ensure that the
system path contains its location. ABH.SW.HotelManagement
How can I solve this? I tried to google it for the past 2 days but I wasn't able to find any solution
This is the only post for this problem, so I'll do my bit for those who use Bootstrap 4.3.1, TypeScript, and VS2015.
First, once you create the project and are about to install Bootstrap 4.3.1 through NuGet, don't let Visual Studio manage TypeScript Typings for you. Check no.
Once Bootstrap and stuff is installed, clean the solution: right click on your solution -> clean solution
Next, open NuGet console (Tools → NuGet Package Manager → Package Manager Console), and install TypeScript 3.0 using this command:
Install-Package Microsoft.TypeScript.MSBuild -Version 3.0.0
Close Visual Studio, open it again, and that's it. Took for me a lot of research to find out that several TypeScript versions cause a lot of conflicts and 3.0 is one of those that actually work.
I had the same issue while trying to update to Bootstrap 4 from Visual Studio 2015. What fixed it for me was installing Typescript 2.2 for Visual Studio 2015 (https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript22forVisualStudio2015). You may need to uninstall previous versions of Typescript Tools for VS2015 from Programs and Features.
I think Bootstrap 4.3.1 , Typescript , VS2015 has some issues with each other.
[e.g.
Compilation error from Angular and typescript in VS 2015 MVC project
]
My scenario in my project got this error
Error The build task could not find node.exe which is required to run
the TypeScript compiler. Please install Node and ensure that the
system path contains its location. ACC_Cor...
I'm using VS2017 while other team member that has problem using VS2015 with TypeScript Tools for Microsoft Visual Studio 2015 3.2.2.0 installed
He told me that after map project from source control there is and alert message of something like his typescript version is newer. So after some googling I think you should look in to this link for more information
https://github.com/Microsoft/TypeScript/issues/17136
VS2015 - Change TypeScript Version
How to run TypeScript in Visual Studio 2015 without require() or requireJS
tldr;
For Vs2015 + Bootstrap 4.3.1 I solved my issue by
Check project property
Uninstall Typescript
Install Typescript version 3.0 https://www.microsoft.com/en-us/download/details.aspx?id=48593

TFS 2015 build SGEN error: 'assembly with incorrect format'

We are upgrading our TFS build system from 2012 to 2015, and are recreating our build machine. We setup the build service, installed necessary dependencies etc. The (legacy) XAML builds are working fine except for the following SGEN error:
SGEN: An attempt was made to load an assembly with an incorrect format: (location of compiled project .dll)
After much Googling and and reading a number of stack overflow articles, I am still at a loss. I referred to multiple pages including:
- SGEN: An attempt was made to load an assembly with an incorrect format
I have tried
Installing Windows SDK 8.1 (and 8.0), 6.1, SDK for Win Server 2008 .net 3.5
Installing .Net 3.5 to 4.6.1
Installing Visual Studio 2010, 2012, 2015
Changing the TFS Build XMAL template file setting MSBuildPlatform to x86 (Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.x86)
Verified the Generate serialization stratgy setting is set to auto for all projects
Changed the Build definition MSBuildPlatform and 'configuration to build' settings to x86, but this generated multiple (unrelated) errors. Ultimately the compiled projects needs to run as x64.
Also
There is no sgen.exe in the C:/Program Files/.... although there are multiple in C:\Program Files (x86). I cannot confirm that there is an x64 version on the system at all, nor can I find where to install one.
Setting the build 'configuration to build' option to x86 is not an option: this needs to be compiled as x64
We are building a very large code base that is owned by a different team, so changing the .SLN or .csproj files is not really a good solution unless absolutely necessary.
The target platforms in the solution and project files were not correct. I believe in the process of resolving other issues, I had modified the project and solution files platform targets.
Since this upgrade was a trial run, we were able to run the upgrade again, which in effect rolled the code back to the last pre-upgrade set of code.

Specflow not working with Nunit 3.0 but working with NUnit 2.6

I am using specflow for BDD for a POC project. I had installed the nuget packages for Specflow ,Specflow.NUnit, NUnitTestAdapter and NUnit (version 2.6). I seemed to be happy since i was getting the expected result.
After a few days, I am working on a new project and i installed all the nuget packages mentioned above. Everything worked fine again. However, when i upgraded Nunit from version 2.6 to the latest stable version 3.0, my tests were not discovered in the Test explorer.
I can continue with the older version but still i would like to go with the latest stable version
I am not sure what steps do i need to take to get my specs running and see all my tests in the Test Explorer.
Any help would be appreciated.
Thanks.
The current version of specflow at time of writing (1.9) won't work with nunit 3. The new version, currently under development (v2) will support it so you will need to wait for that to use nunit v3, or use the beta version from the CI build

Resources