Skip to content

Commit

Permalink
Allow unsafe code in examples (#650)
Browse files Browse the repository at this point in the history
Towards #646.
  • Loading branch information
jskeet authored Oct 27, 2022
1 parent a0a946b commit e3cab89
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions standard/unsafe-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ unsafe_statement

> *Example*: In the following code
>
> <!-- Example: {template:"standalone-lib", name:"UnsafeModifierOnStruct"} -->
> ```csharp
> public unsafe struct Node
> {
Expand Down
1 change: 1 addition & 0 deletions tools/example-templates/code-in-main/Project.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<AssemblyName>$example-name</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions tools/example-templates/standalone-console/Project.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<AssemblyName>$example-name</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions tools/example-templates/standalone-lib/Project.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>$example-name</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

</Project>

0 comments on commit e3cab89

Please sign in to comment.