Add NullableReferenceTypes property#4277
Conversation
Fixes adding configuration-specific property for dotnet#4058 Note: This is a configuraiton-specific property but writes itself without a configuration condition, similar to LangVersion. We need this because it's going to live on the Build property page which pulls from configuration. You can access this using DTE.Configuration.Properties["NullableReferenceTypes"]. We do not yet have a strongly typed API for it and will do that when legacy adds support for it.
|
tag @jcouv |
|
@jcouv here's an example of checking for CPS: https://github.com/dotnet/roslyn/blob/027d0f2535403ae8140d7669035956c2b1713c88/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs#L298. I have no idea how to this in a code fix. |
Pilchie
left a comment
There was a problem hiding this comment.
Additionally, the configured value will automatically flow to the language service through IWorkspaceProjectContext as it's just another commandline argument to the csc task, right?
|
Yes, though I think this will be one of the things that get "evaluation" handled. |
|
Just received this in VS 2019. The "NullableReferenceTypes" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property. Is this related to the above? |
|
Fixes adding configuration-specific property for #4058
Note: This is a configuraiton-specific property but writes itself without a configuration condition, similar to LangVersion. We need this because it's going to live on the Build property page which pulls from configuration.
You can access this using DTE.Configuration.Properties["NullableReferenceTypes"]. We do not yet have a strongly typed API for it and will do that when legacy adds support for it.