dotnet / dotnet/vscode-csharp

C# Extension offers to generate launch.json for unit test projects

Open
#1,392 0 comments 0 reactions 0 assignees View on GitHub
Launch and Task Assets OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

## Environment data
C# Extension version: 1.9.0-beta2

## Steps to reproduce
1. Create a new xunit test with `dotnet new xunit`
2. Open the directory in VS Code
3. Open up a C# file

## Expected behavior
Since a unit test isn't runnable, the C# extension shouldn't put up the 'Required assets to build and debug are missing'.

## Actual behavior
The banner comes up, and will generate a launch.json.

## Notes
I played around with fixing this but it isn't as simple as I hoped. Even though the project doesn't directly set `OutputType` like an exe project does, it must inherit something that does set that setting. Also we don't currently expose the set of PackageReferences back to the C# extension from OmniSharp, and node also doesn't have an XML parser built in. So I think we would need to implement something on the OmniSharp side to give us a hint that the project looks like a unit test.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.