Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

It is not working with C# 7.2 #6

Open
tiksn opened this issue Jan 4, 2018 · 5 comments
Open

It is not working with C# 7.2 #6

tiksn opened this issue Jan 4, 2018 · 5 comments

Comments

@tiksn
Copy link

tiksn commented Jan 4, 2018

When C# version is set to default (7.0 currently) it works and shows compiler errors, but when I am changing it to latest (7.2 currently) it fails.

@tiksn tiksn mentioned this issue Jan 4, 2018
4 tasks
@mihasic
Copy link
Owner

mihasic commented Jan 6, 2018

thank you for reporting. I'll check next week if there's an easy fix

@mihasic
Copy link
Owner

mihasic commented Jan 8, 2018

@tiksn , could you provide more details?

it works fine on the sample project when I add:

  <PropertyGroup>
    <LangVersion>7.2</LangVersion>
  </PropertyGroup>

to the csproj file. Tried with latest VS2017 Pro (15.5.2)

@tiksn
Copy link
Author

tiksn commented Jan 11, 2018

currently 7.2 and latest are the same thing, because currently latest minor version of c# is 7.2 and latest major version (default version) is 7.0, but that might change in near future that is why I am keeping latest in my projects

@tiksn
Copy link
Author

tiksn commented Jan 11, 2018

Also I will describe my issue with more details because it is purely written and not clear.

I have a project which is using DateTimeOffset.Now. With your extension installed it should fail and show an errors.

if the c# version of project is default (7.0 currently) it fails (as it should be) and shows errors.
But with c# version of project as latest (7.2 currently) it is not showing errors.

Also I installed your extension from my branch (the one that I created PR), it shows errors but lets you run application anyway. Is it by design, or it is a bug?

@mihasic
Copy link
Owner

mihasic commented Jan 12, 2018

But with c# version of project as latest (7.2 currently) it is not showing errors.

I wasn't able to reproduce it, so would be nice if you can figure out the minimum reproduction (and, maybe, update the sample project, so I can take a look)

Also I installed your extension from my branch (the one that I created PR), it shows errors but lets you run application anyway. Is it by design, or it is a bug?

That's by design of VSIX extensions: dotnet/roslyn#5493
The only way to prevent project from building would be: extract analyzer itself and publish on nuget (or similar) and load as an analyzer dependency in the project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants