Skip to content

Commit

Permalink
doc: recommend treating CS9057 as error
Browse files Browse the repository at this point in the history
CS9057 is a compiler warning issued when a consuming project is using
an earlier version of the .NET compiler than was used to compile the
Introspection generator. Such a mismatch can have serious,
hard-to-diagnose downstream consequences for users. This change
recommends treating CS9057 as an error in consuming projects, to make
those issues easier to diagnose and fix.
  • Loading branch information
wlsnmrk committed Feb 21, 2025
1 parent fd43515 commit 65b1d97
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/logic_blocks/02_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ Find the latest version number of LogicBlocks, its diagram generator, and the in
Don't forget to include the `PrivateAssets="all"` and `OutputItemType="analyzer"` attributes on generator package references.
:::

:::caution
We strongly recommend treating warning `CS9057` as an error to catch possible compiler-mismatch issues with the Introspection generator. (See the [Introspection] README for more details.) To do so, add a `WarningsAsErrors` line to your `.csproj` file's `PropertyGroup`:

```xml
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
...
<!-- Catch compiler-mismatch issues with the Introspection generator -->
<WarningsAsErrors>CS9057</WarningsAsErrors>
...
</PropertyGroup>
```
:::

:::tip
Always use the same version of the LogicBlocks diagram generator that you use for LogicBlocks, since they are updated together.
:::
Expand All @@ -29,3 +43,4 @@ Always use the same version of the LogicBlocks diagram generator that you use fo
[Chickensoft.LogicBlocks.DiagramGenerator]: https://www.nuget.org/packages/Chickensoft.LogicBlocks.DiagramGenerator#versions-body-tab
[Chickensoft.Introspection.Generator]: https://www.nuget.org/packages/Chickensoft.Introspection.Generator
[Chickensoft.LogicBlocks]: https://www.nuget.org/packages/Chickensoft.LogicBlocks
[Introspection]: https://github.com/chickensoft-games/Introspection

0 comments on commit 65b1d97

Please sign in to comment.