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 compiler.AllowUnsafe = true; to allow building unsafe code #100

Open
rapidgiga opened this issue Oct 12, 2024 · 0 comments
Open

Add compiler.AllowUnsafe = true; to allow building unsafe code #100

rapidgiga opened this issue Oct 12, 2024 · 0 comments

Comments

@rapidgiga
Copy link

Some functions return pointers:
image

However this results in the following build failure:

[DotX64Dbg] Rebuilding plugin 'RapidString'...
[DotX64Dbg] Build failed
C:\Users\rapid\Documents\x64dbg\release\dotplugins\RapidString\plugin.cs(4,29): error CS0227: Unsafe code may only appear if compiling with /unsafe
C:\Users\rapid\Documents\x64dbg\release\dotplugins\RapidString\plugin.cs(9,23): error CS0012: The type 'IsSignUnspecifiedByte' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime.CompilerServices.VisualC, Version=6.0.0.0, Culture=neutral, PublicKeyToken=[b03f5f7f11d50a3a](x64dbg://localhost/address64#b03f5f7f11d50a3a)'.
[DotX64Dbg] Build failed

This can be resolved by adding compiler.AllowUnsafe = true; to this file:

var options = new CSharpCompilationOptions(forScripting ? OutputKind.ConsoleApplication : OutputKind.DynamicallyLinkedLibrary)

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