Skip to content

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

@rapidgiga

Description

@rapidgiga

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions