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

declare AllowUnsafeBlocks=true in .csproj file or avoid unsafe code completly in project #39

Open
emanuelb opened this issue May 28, 2021 · 0 comments

Comments

@emanuelb
Copy link

Need to add:

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

in this <PropertyGroup> tag:

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>

Otherwise compilation fail with errors such as:

Common/SecureStringExtensions.cs(66,17): error CS0227: Unsafe code may only appear if compiling with /unsafe [/home/appuser/app/atomex/atomex.mobile/atomex.client.core/Atomex.Client.Core/Atomex.Client.Core.csproj]

Adding /p:AllowUnsafeBlocks=true to msbuild is another solution but it's better to declare it in csproj file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant