Oct
21
2016

How to enable unsafe keyword for Unity C#

Enabling “unsafe” for unity c# is quite simple:
– Add these 2 files to your project folder (inside Assets/ folder root)
– “smcs.rsp” and “gmcs.rsp”
– both files contain only 1 line of text: -unsafe
– Then restart Unity and VisualStudio/Monodev

*Note: Unity 5.5 wants also file “mcs.rsp”, 5.4 and lower versions wont need it

(You can download those files clicking “view raw” and then save the page)


-unsafe

view raw

gmcs.rsp

hosted with ❤ by GitHub


-unsafe

view raw

mcs.rsp

hosted with ❤ by GitHub


-unsafe

view raw

smcs.rsp

hosted with ❤ by GitHub

references:
https://www.dotnetperls.com/unsafe
https://msdn.microsoft.com/en-us/library/t2yzs44b.aspx


Related Posts

About the Author:

.fi

2 Comments + Add Comment

  • What is the keyword unsafe used for?
    -thanks

  • Oh, just saw your links. Thanks

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Github Join Discord Twitch Instagram BlueSky

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.