question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

csharp.unitTestDebuggingOptions and args property

See original GitHub issue

Environment data

dotnet --info output: .NET Core SDK (reflecting any global.json): Version: 2.1.302 Commit: 9048955601

Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/2.1.302/

Host (useful for support): Version: 2.1.2 Commit: 811c3ce6c0

.NET Core SDKs installed: 2.1.202 [/usr/share/dotnet/sdk] 2.1.302 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

VS Code version: 1.25.1 C# Extension version: 1.15.2

Steps to reproduce

Create an MSTest project. Create a runsettings file with parameters. Add this settings to the workspace settings "csharp.unitTestDebuggingOptions":{ "args":["--settings:myfile.runsettings"] }

Expected behavior

The parameters are loaded to the TestContext.Properties.

Actual behavior

Unable to access this parameters when I debug the test when reading TestContext.Properties.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
AOne-Tcommented, Feb 1, 2019

Any progress on that issue? We have the same problem. Our projects extensively use custom variable in projects (SolutionDir) which is not present in VS Code. We configured tasks.json to provide it and it works. If running from command line we use “export SolutionDir=” (we use Linux) before running dotnet. But this variable blocks our usage of “Run Test/Debug Test” Code Lens. Providing custom options or/and variables would be very helpful.

2reactions
jkoritzinskycommented, Nov 12, 2020

I’ve started hitting this issue working on the DllImportGenerator project in dotnet/runtimelab.

Read more comments on GitHub >

github_iconTop Results From Across the Web

csharp.unitTestDebuggingOptions and args property
Coming soon: A brand new website interface for an even better experience!
Read more >
How to debug dotnet test in VS Code? - Stack Overflow
The following answer has been tested on VSCode v1.62.3 and dotnet tools v5.0.403. Assuming you have a .NET solution with a structure like...
Read more >
dotnet run command - .NET CLI | Microsoft Learn
Delimits arguments to dotnet run from arguments for the application ... Otherwise, the command assumes that -p is short for --property .
Read more >
Debugging in Visual Studio Code
For debugging other languages and runtimes (including PHP, Ruby, Go, C#, Python, ... launching the debugger; args - arguments passed to the program...
Read more >
CS585 : Getting Started with Visual Studio Tutorial
Command line Arguments ... To set command-line arguments in Visual Studio, right click on the project name, then go to Properties. In the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found