-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Visual Studio Code support #2015
Improve Visual Studio Code support #2015
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2015 +/- ##
==========================================
+ Coverage 83.86% 83.87% +0.01%
==========================================
Files 192 192
Lines 6184 6184
==========================================
+ Hits 5186 5187 +1
+ Misses 998 997 -1
|
are all the 'example' stuff for developing in a container required? |
No. Can you elaborate if you have any concerns? Nothing here is required. It is intended to help others contribute. 😉 |
No major concerns. Just minors:
|
@bruno-garcia @reyang |
Yes I prefer not having any IDE/editor specific files unless there is a way to keep them up-to-date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@reyang @bruno-garcia I removed the IDE/editor-specific files. 3250153 |
@@ -1,6 +1,6 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks> | |||
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the change only for ordering? Does VSCode enforce the ordering of TargetFrameworks
if so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, you are correct. VS Code C# extension does not work good with projects that target multiple frameworks.
More:
PR open-telemetry#2015 fixed the target framework ordering to allow better VS Code due to the challenges with VS Code multi-targeting: dotnet/vscode-csharp#1783 dotnet/vscode-csharp#3754 Short version: VS Code support is better if you list the latest .NET Core frameworks first. Recent projects and updates have lost that ordering so VS Code isn't great on non-Windows. This restores that order and updates the latest projects.
Why
Make it easier (or even possible) to develop OTel .NET using VS Code. Right now if you try to use VS Code you would get tons of errors. Moreover, for me, Intellisense was not even working.
Changes
.csproj
to reduce the number of "problems". For me, it reduced the number of problems from ~400 to ~100. It was discussed on Slack here. Most of the ones that left are ASP.NET related which is not worth fixing - it would probably require a dedicated.sln
for non-Windows dev environments. Unfortunately, AFAIK the C# extension does not support*.proj
files..vscode
and.devcontainer
to.gitignore
in case someone wants to use different settingsTesting
I was testing everything in Development Container (on Windows) that is created in this PR.
It would be great if someone double-checks if this PR does not break anything for Visual Studio. Low probability, but worth ensuring.