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

Add a note about the point-in-time concern with VS and the CLI #12503

Merged
merged 2 commits into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/csharp/nullable-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ The nullable annotation context and nullable warning context can be set for a pr
- `safeonlywarnings`: The nullable annotation context is **disabled**. The nullable warning context is **safeonly**.
- Variables of a reference type are oblivious. All safety nullability warnings are enabled.

> [!IMPORTANT]
> The `Nullable` element was previously named `NullableContextOptions`. The rename ships with Visual Studio 2019, 16.2-p1. The .NET Core SDK 3.0.100-preview5-011568 does not have this change. If you are using the .NET Core CLI, you'll need to use `NullableContextOptions` until the next preview is available.

You can also use directives to set these same contexts anywhere in your project:

- `#nullable enable`: Sets the nullable annotation context and nullable warning context to **enabled**.
Expand Down
3 changes: 3 additions & 0 deletions docs/csharp/tutorials/nullable-reference-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Create a new console application either in Visual Studio or from the command lin
<Nullable>enable</Nullable>
```

> [!IMPORTANT]
> The `Nullable` element was previously named `NullableContextOptions`. The rename ships with Visual Studio 2019, 16.2-p1. The .NET Core SDK 3.0.100-preview5-011568 does not have this change. If you are using the .NET Core CLI, you'll need to use `NullableContextOptions` until the next preview is available.

> [!NOTE]
> When C# 8 is released (not in preview mode), the `Nullable` element will be added by new project templates. Until then, you'll need to add it manually.

Expand Down
3 changes: 3 additions & 0 deletions docs/csharp/tutorials/upgrade-to-nullable-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ A good next step is to turn on the nullable annotation context and see how many
<Nullable>enable</Nullable>
```

> [!IMPORTANT]
> The `Nullable` element was previously named `NullableContextOptions`. The rename ships with Visual Studio 2019, 16.2-p1. The .NET Core SDK 3.0.100-preview5-011568 does not have this change. If you are using the .NET Core CLI, you'll need to use `NullableContextOptions` until the next preview is available.

Do a test build, and notice the warning list. In this small application, the compiler generates five warnings, so it's likely you'd leave the nullable annotation context enabled and start fixing warnings for the entire project.

That strategy works only for smaller projects. For any larger projects, the number of warnings generated by enabling the nullable annotation context for the entire codebase makes it harder to fix the warnings systematically. For larger enterprise projects, you'll often want to migrate one project at a time. In each project, migrate one class or file at a time.
Expand Down