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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Releasing and reloading DLL in editor?

Discussion in 'Editor & General Support' started by larku, Apr 21, 2015.

  1. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    I use a custom native DLL in my game which is built for each platform I deploy to.

    I'm using Unity 5 64bit Windows version. To run my game in the editor I build my native library as a Win64 DLL for the editor to use, this works great.

    But..

    Every time I update the library (which is often) if I have run the game in the Editor (and it's no longer playing) I am unable to overwrite the current DLL in use by the Editor.

    Question:

    Is there any way to have Unity release its lock on the DLL and then reload it next time I click play? As it is now I need to exit Unity, copy over the DLL and restart Unity - rather laborious and time consuming to do 50 times a day (ohhh, the first world problems... poor me.... :) )
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,672
    Sadly no... Once native dll is loaded, it's never released by Mono...
     
  3. JonathanBolten

    JonathanBolten

    Joined:
    Dec 15, 2012
    Posts:
    50
  4. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
  5. pragmascript

    pragmascript

    Joined:
    Dec 31, 2010
    Posts:
    103
    It seems like the situation has not changed in Unity 2020.1?
    You still have to restart the editor if you want to update a native DLL?
     
    wwaero and awsapps like this.