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

NullableContextOptions no longer works #35901

Closed
drewnoakes opened this issue May 23, 2019 · 3 comments
Closed

NullableContextOptions no longer works #35901

drewnoakes opened this issue May 23, 2019 · 3 comments
Assignees

Comments

@drewnoakes
Copy link
Member

drewnoakes commented May 23, 2019

This issue has been moved from VSTS ticketId 896657.

In our .csproj files, this used to enable nullable context:

<NullableContextOptions>enable</NullableContextOptions>

Now, after upgrading to 16.2 preview 1, it no longer works. The compiler throws errors as if we were not in a nullable context. Surrounding code with #nullable enable/restore still works, but it's not feasible to do it for each and every code file in our solution.


Original comments

Pierre Arnaud on 5/22/2019, 05:59 PM

I've the exact same issue on all my projects.

Visual Studio Feedback System on 5/22/2019, 06:02 PM

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Kexy Biscuit on 5/22/2019, 07:14 PM

Me too, this breaks nearly everything for me.

richf on 5/22/2019, 10:04 PM

Same problem.

Building from commandline does not have any issue

Anthony Trudeau on 5/23/2019, 08:20 AM

@VisualStudio on Twitter directed me to share my comments here after some messages there.

I'm on 16.1 within a new WPF project and using the element in the project file has no affect. There are no errors, warnings, or otherwise. Using the directive in the individual code files works as expected.

@jcouv
Copy link
Member

jcouv commented May 23, 2019

As of 16.116.2, the property was renamed to Nullable. This name is simpler and aligns with the command-line flag.
I'll broadcast on Twitter and check StackOverflow for the inevitable question. Sorry for the inconvenience.

PR #35516

@drewnoakes
Copy link
Member Author

I took a pass over the top Stack Overflow posts and edited/answered/commented with this updated info.

@jcouv
Copy link
Member

jcouv commented May 29, 2019

Correction, the change to <Nullable> was in 16.2p1 (not in 16.1). Sorry for the confusion

@jcouv jcouv closed this as completed May 29, 2019
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

2 participants