I am using Visual studio code and when I try to run an unsafe code it throws the following error ""message": Unsafe code may only appear if compiling with /unsafe"
and as in visual studio, it does not have option like project->properties.
I am using Visual studio code and when I try to run an unsafe code it throws the following error ""message": Unsafe code may only appear if compiling with /unsafe"
and as in visual studio, it does not have option like project->properties.
In the
.csproj
file, just add<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
to any
<PropertyGroup>
block.No need to add anything to
task.json
.unsafe (C# Compiler Options)
XML
Usage
Method level
Inline Block
Class Level