Skip to content
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

Fake (non-existent) problems/bugs reported by c# extension in VSCode. #3806

Closed
StasD opened this issue May 25, 2020 · 3 comments
Closed

Fake (non-existent) problems/bugs reported by c# extension in VSCode. #3806

StasD opened this issue May 25, 2020 · 3 comments

Comments

@StasD
Copy link

StasD commented May 25, 2020

Environment data

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

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.300/

Host (useful for support):
Version: 3.1.4
Commit: 0c2e69caa6

.NET Core SDKs installed:
3.1.300 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

VS Code version: 1.45.1
C# Extension version: 1.21.18, 1.22.0

Actual behavior

I'm working on new asp.net application created with dotnet new react.

There are fake (non-existent) problems/bugs reported by c# extension in VSCode.

They are fake, because dotnet build, and even running the app with ".NET Core Launch (web)" in the RUN panel works perfectly fine.

Example 1)
Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater.
(for code e.g. using var cnn = DefaultCnn();)
This one disappears if I add <LangVersion>8.0</LangVersion> to .csproj file, but it shouldn't be necessary.

Example 2)
Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute
(for code in obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs)

Also several of these (after building release):
Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute (for code in obj/Release/netcoreapp3.1/[MyProjectName].AssemblyInfo.cs)

Expected behavior

No fake warnings. All warnings should be consistent with what dotnet build does.

@StasD
Copy link
Author

StasD commented May 25, 2020

I managed to fix it, I think...
Had standalone Mono installed. Version 6.4. So I decided to upgrade it to the latest version, 6.8. After I did that, all those fake warnings in VSCode suddenly disappeared.
Still... This means there is still a problem with the c# extension. Why would it even look at standalone Mono if it ships with (or downloads on first run) its own? Especially when the installed Mono had older version... You need to fix this or update the documentation about the impact of having standalone Mono installed.

Update: Warnings about duplicate attributes re-appeared again... But at least those about 'Feature is not available in C# 7.3' seem to be gone for good.

@ghost
Copy link

ghost commented Aug 5, 2020

This also happens in the normal mcr.microsoft.com/dotnet/core/sdk:3.1 docker image. That image has no mono in it whatsoever.

@JoeRobich
Copy link
Member

Closing as original poster resolved their issue.

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants