Allow choosing the Target Framework.
See original GitHub issueIssue Description
As a user who has to target multiple Target Framework versions, I would like to be able to choose the specific framework Omnisharp should use. This functionality is homologous to this Visual Studio feature:
This will allow macro’s like #if NETSTANDARD
and #if NETFRAMEWORK
to work correctly and provide intellisense in those areas.
Environment information
VSCode version: 1.44.2 C# Extension: 1.21.17
Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.201 Commit: b1768b4ae7Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.201\
Host (useful for support): Version: 3.1.3 Commit: 4a9f85e9f8
.NET Core SDKs installed: 2.1.504 [C:\Program Files\dotnet\sdk] 2.1.508 [C:\Program Files\dotnet\sdk] 2.1.602 [C:\Program Files\dotnet\sdk] 2.1.700 [C:\Program Files\dotnet\sdk] 2.1.801 [C:\Program Files\dotnet\sdk] 2.2.202 [C:\Program Files\dotnet\sdk] 2.2.300 [C:\Program Files\dotnet\sdk] 2.2.401 [C:\Program Files\dotnet\sdk] 3.0.100-preview6-012264 [C:\Program Files\dotnet\sdk] 3.1.101 [C:\Program Files\dotnet\sdk] 3.1.201 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0-preview6.19307.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0-preview6-27804-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0-preview6-27804-01 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
azure-account | ms-vscode | 0.8.9 |
csharp | ms-dotnettools | 1.21.17 |
debugger-for-chrome | msjsdiag | 4.12.6 |
debugger-for-edge | msjsdiag | 1.0.14 |
docomment | k–kato | 0.1.9 |
dotnet-test-explorer | formulahendry | 0.7.1 |
ecdc | mitchdenny | 1.3.0 |
EditorConfig | EditorConfig | 0.14.5 |
gitlens | eamodio | 10.2.1 |
markdown-all-in-one | yzhang | 2.8.0 |
msbuild-project-tools | tintoy | 0.3.5 |
ng-template | Angular | 0.901.4 |
partial-diff | ryu1kn | 1.4.1 |
terraform | mauve | 1.4.0 |
uridecode | sryze | 0.3.5 |
vscode-icons | vscode-icons-team | 10.1.1 |
vscode-solution-explorer | fernandoescolar | 0.3.9 |
vscode-typescript-tslint-plugin | ms-vscode | 1.2.3 |
vscode-versionlens | pflannery | 0.26.0 |
vscode-xml | redhat | 0.11.0 |
vscode-yaml | redhat | 0.7.2 |
vscodeintellicode | VisualStudioExptTeam | 1.2.6 |
vsliveshare | ms-vsliveshare | 1.0.2104 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:7
Top GitHub Comments
When trying to use VS Code for the development of https://github.com/open-telemetry/opentelemetry-dotnet I get a ton of errors like:
I guess that this is because the assemblies inside the
System.Diagnostics.DiagnosticSource
NuGet package have different versions for different targets.net45
andnet46
have version5.0.0.1
while the others (net5
,netstandard1.1
andnetstandard1.3
) have5.0.0.0
. My understanding is that VSCode C# extension usesnet452
forOpenTelemetry.Api
andnetcoreapp2.1
forOpenTelemetry.Tests
as TargetFrameworks (because of https://github.com/OmniSharp/omnisharp-vscode/issues/1783).Having the ability to choose a platform could help I guess. It should basically help in any project which targets multiple frameworks.
In full support of this thread. It’s the 1+ VS has over Code. Can’t imagine how much time I lost over the years to reorder target framework first, restart Omnisharp, and wait for the service to boot up.