Visual Studio errors can be very annoying. Right?

Sometimes we spend hours or even days troubleshooting problems.. Ugh!

So I’ve compiled a post on the most common Visual Studio errors that my students and I encountered. I will maintain and update this post over time.

I also supplied information on how to fix these errors.

Hope it helps… 

Visual Studio Error

The command “chmod + x” exited with code 9009

Error Message

The command “chmod + x” exited with code 9009

Command chmod + x Visual Studio error

The Problem

The problem is that probably occurs when you are trying to build a solution. At that point, in your console, you get this error.

This stems from the fact that you have a space somewhere in your folder structure. For example:

“C:SourceGithubFolder With Space

The Solution

Simply rename your folder or file so that it doesn’t have a space in it. For example, change the above to:

“C:SourceGithubFolderWithSpace

Your solution will now build correctly

I fixed The command "chmod + x" exited with code 9009 error. Thanks to this article https://www.ultimateqa.com/?p=8810 Click To Tweet

The reference assemblies for framework “.NETFramework,Version=v4.6.1” were not found…

Error Message

error MSB3644: The reference assemblies for framework “.NETFramework,Version=v4.6.1” were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

The Problem

The problem is that you need to install the correct version of .NET Framework to open this solution.

The Solution

  1. Follow the instructions here to get to the Modify screen of Visual Studio
  2. You might be prompted to update VS Installer, go ahead and do so
  3. In the Installation Details pane on the right hand side, make sure that you select all of the .NET Framework and .NET Core installations. That way, your environment can support all current .NET implementations.
  4. Click the Modify button
Install all .NET environments
Install all .NET environments

Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.

Error Message

Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.

Related tech stack

Visual Studio, MsTest

The Solution

In Visual Studio go to Tools > Options > Debugging > uncheck “Enable Just My Code”


Unit tests not running in Visual Studio Test Explorer

Error message

UTA031: class … does not have valid TestContext property. TestContext must be of type TestContext, must be non-static, public and must not be read-only. For example: public TestContext TestContext.

The solution

If you are using the MStest unit testing framework, make sure that your TestContext property follows the specifications listed in the message. Meaning non-static, public and must not be read-only.

It should look like this:

public TestContext TestContext { get; set; }

Unit tests not showing up in Visual Studio test explorer

Error Message

Something like this below:

…\MSTest.TestAdapter.1.2.0/build/_common/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll

The Problem

  • Visual Studio Version: 15.0.X
  • MSTest Adapter version: 1.18

There seems to a be bug with Visual Studio and the Visual Studio test adapter when you are trying to work with the versions listed above.

The Solution

To fix this problem, you need to update Visual Studio to version 15.5.2 and your MSTest Adapter in the Nuget package manager to version 1.2.0.

Are your unit tests not showing up in the Visual Studio Test Explorer? Here is the fix https://wp.me/p7absY-4E #automation #development #programming #dotnet Click To Tweet

Summary

Hope this was helpful?

Is there an error that you need help resolving? Please comment below and I’ll try to resolve it for you.

0 Shares
Tweet
Share
Share
%d bloggers like this: