Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Running unsafe code on hololens

Discussion in 'Scripting' started by lmbarns, Apr 30, 2016.

  1. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    I got my dev environment set up and tested my Unity app on the hololens. Now I'm trying to use some of the assets from the holotoolkit and I can't compile because there are a dozen scripts using functions like:
    Which causes the compiler to throw errors
    So I created a file called smcs.rsp and added the line -unsafe to it for the compiler, but the errors are still preventing me from building due to the unsafe flag.

    Any ideas? Thanks
     
  2. PrimalCoder

    PrimalCoder

    Joined:
    Aug 12, 2014
    Posts:
    9
  3. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    You also have to allow unsafe code in the Visual Studio project. However, Unity tools for Visual Studio doesn't allow you to access the project properties anymore since they get overwritten by Unity very often. You will need to edit the .csproj file of your project and set the AllowUnsafeBlocks occurrences to true whenever you want to run in the editor or create a build.