Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

HOT RELOAD - Edit Code Without Compiling!

Discussion in 'Assets and Asset Store' started by reese015, Jan 23, 2023.

  1. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey there. I don't get this error when I open a project with Hot Reload installed.

    This omnisharp log seems to be relevant. If you're missing it, you might want to look for related errors in the log output:

    [info]: OmniSharp.MSBuild.ProjectManager
    Update project: SingularityGroup.HotReload.Editor


    But if the error doesn't cause issues for you, you might as well ignore it.
     
  2. wubuzi

    wubuzi

    Joined:
    Jan 19, 2022
    Posts:
    9
    For now, I ignore it, but I think I should let you know this:

    [warn]: OmniSharp.MSBuild.ProjectLoader
    Failed to resolve main reference "SingularityGroup.HotReload.RuntimeDependencies2019" as it was generated for the ".NETFramework,Version=v4.7. NETFramework,Version=v4.7. NETFramework,Version=v4.7.1" framework.
    [warn]: OmniSharp.MSBuild.ProjectLoader
    Failed to resolve the main reference "SingularityGroup.HotReload.RuntimeDependencies2020" as it was generated for the ".NETFramework,Version=v4.7. NETFramework,Version=v4.7. NETFramework,Version=v4.7.2" framework. This framework version is higher than the current target framework ".
    [info]: OmniSharp.MSBuild.ProjectManager
    Successfully loaded project file 'h:\UnityProjects\Beauty Escort\SingularityGroup.HotReload.Runtime.csproj'.
    h:\UnityProjects\Beauty Escort\SingularityGroup.HotReload.Runtime.csproj
    C:\Program Files\dotnet\sdk\6.0.201\Microsoft.Common.CurrentVersion.targets(2301,5): Error: Failed to resolve main reference 'SingularityGroup. HotReload.RuntimeDependencies2019" because it was generated for the ".NETFramework,Version=v4.7.2" framework. NETFramework,Version=v4.7.2" framework. This framework version is higher than the current target framework ".NETFramework,Version=v4.7.1".
    C:\Program Files\dotnet\sdk\6.0.201\Microsoft.Common.CurrentVersion.targets(2301,5): Error: Failed to resolve main reference "SingularityGroup. HotReload.RuntimeDependencies2020" because it was generated for the ".NETFramework,Version=v4.7.2" framework. NETFramework, Version=v4.7.2" framework. This version of the framework is higher than the current target framework, ".NETFramework, Version=v4.7.1".
     
    PencilBow likes this.
  3. profuzzy

    profuzzy

    Joined:
    Mar 13, 2015
    Posts:
    48
    This should have been default 10 years ago.
    AKA: Run without full recompile, make live changes.. etc
     
    VirtusH, Koara92 and PencilBow like this.
  4. VirtusH

    VirtusH

    Joined:
    Aug 18, 2015
    Posts:
    95
    My coworker and I have found Hot Reload to be less reliable lately (on 2022.3.4).

    He modified a debug log, Hot Reload said patched, but no change in logging.
    I have a ton of issues with Rider and Unity generally of late, with features like debugging just not working well (I want to doubt that this even has anything to do with Hot Reload), but then when I hot reload anything, debugging is virtually guaranteed to glitch and error out.
     
  5. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey, if the change was made inside coroutine or async method, changes are only reflected when that coroutine/task is recreated. Perhaps this is what you were experiencing? We can add a warning when this happens to avoid confusion.

    If it was some other change, feel free to DM me with more details on what change was made and in which context.

    We haven't made any changes to the debugger recently, so I assume something in your project changed. Feel free to let me know the details of the issues you're having with it though so I can provide some assistance.
     
  6. VirtusH

    VirtusH

    Joined:
    Aug 18, 2015
    Posts:
    95
    A warning for any edge case would be greatly appreciated, I don't recall if the log was in a coroutine, but we don't use them often.

    I'm trying my best to nail down where my instability issues are coming from, it's mostly Unity crashing and Rider just not debugging properly. If I encounter anything specific to Hot Reload, I'll relay it immediately.
     
    PencilBow likes this.
  7. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,333
    This looks good, though if you see minutes of time saved on each code change you must have a very slow PC!

    However the pricing is still very high for business users - but it looks like most might fit the indie licensing, was the 10+ employee a recent addition? Because it is a bit confused now as Business has a tick by Pro/Enterprise while Indie does not
     
  8. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey there. We believe the pricing for a business plan is fair, considering the amount of time saved on large projects. We are open to considering individual approaches to companies who don't think that is the case (e.g. via a call).

    Not all Pro/Enterprise users are eligible to use the Hot Reload Indie license, and that is why we indicate full support for this type of license in the Business plan. Information at the top of each plan is there to help you understand when you should purchase either Business or an Indie license.
     
  9. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,333
    I think it will get there, but it does appear limited until the following are covered because I would be constantly doing one of these:
    • Adding or editing fields in classes
    • Adding new classes or structs
    • Adding C# files
     
  10. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    From what users have reported so far (including companies on the Business plan), it's clear that existing Hot Reload features provide huge time-saving potential. It can save hours allowing you to fix bugs in play mode or with on-device build etc.

    The features you've listed are on the roadmap, and your early involvement will help with development. Of course, you can choose to delay and wait for these features to be available.

    You can try Hot Reload for free with a 30-day trial: https://hotreload.net/download and see for yourself if it's a good investment.
     
    VirtusH and andyz like this.
  11. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    I second the "Adding new fields" feature, would be a fantastic addition. Also changing constants (const floats, ints etc) values, I'm surprised that wasn't supported.
     
  12. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    We are working on adding new fields feature at the moment. ETA is 2 weeks from now. I will take into consideration your need for support of patching constant values, but can't tell where it will be on the list of prioritized features.
     
    VirtusH and eterlan like this.
  13. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey everyone!

    We just released version 1.12.4.

    Fixes:
    • Made Hot Reload correctly identify changing field types and removing fields as unsupported changes
    • Fixed an issue with unity event functions not executing when entering Play Mode
    • Made Auto Recompile Unsupported Changes option more reliable
    • Assembly definition files and native plugins (e.g. dll files) can automatically trigger Unity Recompile
     
    VirtusH likes this.
  14. VirtusH

    VirtusH

    Joined:
    Aug 18, 2015
    Posts:
    95
    Seeing this exception when adding an override of a virtual method. Not sure if that's meant to be supported or not, but figured I'd share.

    upload_2023-8-14_1-11-20.png
     
  15. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Thanks for sharing this. Adding override methods is not supported yet but to my knowledge it should give a different error. We will investigate.
     
  16. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    51
    hi,I have many error in vscode
    version 1.12.4
    upload_2023-8-20_23-23-14.png
    I
     
  17. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Thanks for reporting this. The fix will be included in the next version (coming out in a few days).
     
  18. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey everyone!

    We just released version 1.12.5.

    Fixes:
    • Fixed being able to dismiss the "Rate App" prompt
    • Fixed the "Show on Startup" option reverting to "Always"
    • Ensure original Auto Refresh preference is restored when Hot Reload is uninstalled
    • Fixed harmless errors in VS Code
     
  19. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Latest version (1.12.5) should have the fix for it. You might need to regenerate your project files like in the screenshot below: BnyQYru3Xb_2023-08-21_12-25-46.png
     
    FcsVorfeed likes this.
  20. AndreasClifftop

    AndreasClifftop

    Joined:
    Jun 25, 2020
    Posts:
    5
    I'm getting a lot of errors when creating a build through BuildPipeline.BuildPlayer in our project (we have a custom build tool). I've unticked "Include Hot Reload in player builds" yet it still seems to be trying to build with Hot Reload. Building through the standard Build Settings window works fine though.
    Also, when shutting down Unity with Hot Reload running locks up Unity with the following progressbar looping indefinitely. If I first stop Hot Reload and then shut down Unity it closes as it should.
     

    Attached Files:

  21. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey Andreas,

    The first issue you've mentioned is a known one and we're looking into it.
    The workaround is to remove Hot Reload package from the build machine before starting Unity.

    For the second issue: what is the Unity version that you're using?
    And did it start happening with a recent update or was this way before?
     
  22. AndreasClifftop

    AndreasClifftop

    Joined:
    Jun 25, 2020
    Posts:
    5
    We're running Unity 2021.2.7f1. I believe it started happening 1-3 months ago (I've been too lazy to report it). Hard to say exactly when as I usually leave Unity on and the first times I just chalked it up to Unity being Unity.
     
  23. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Andreas,

    You can resolve this issue by adding a line in EditorCodePatcher.cs:101 on the latest Hot Reload version:



    We will include this fix in the next release. Thanks for reporting this!
     
    AndreasClifftop likes this.
  24. ChrisIsAwesome

    ChrisIsAwesome

    Joined:
    Mar 18, 2017
    Posts:
    184
    There seems to be a bug where it doesn't detect method name changes as an unsupported change. So for example, changing Update to FixedUpdate doesn't hot reload and doesn't recompile automatically, forcing me to compile manually, even though I have "Recompile immediately" enabled.

    There are no errors in log, and it does say "Hot reloading FixedUpdate" as if it worked, but any changes I make within the method until I manually recompile won't hot reload.

    It would be nice to have a button for manually recompiling in Hot Reload window for if something goes wrong with it. Currently, as I'm not sure what the most convenient way to recompile is, I add a script that I then delete, so I end up recompiling twice each time I change a method name.
     
    Last edited: Aug 30, 2023
  25. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey there, thanks for reporting this issue. We will investigate it and deploy a fix in one of upcoming versions.

    We are also working on UI improvements, which will include a recompile button.

    You can use default Unity shortcut for recompiling (Ctrl+R), which is the most convenient way to do this right now.
     
    ChrisIsAwesome likes this.
  26. moncastro

    moncastro

    Joined:
    Aug 13, 2015
    Posts:
    7
    Hi,

    Thanks for the great tool I found it very useful! However, I've noticed that it doesn't track script changes inside symlinked directories. Would it be possible to handle this issue or provide guidance on making it work with symlinks?

    I'm using Mac 12.6 and Unity LTS 2021.3.8f1
     
    Last edited: Aug 31, 2023
  27. qlixes

    qlixes

    Joined:
    Jul 24, 2020
    Posts:
    2
    Dear Hot Reload,

    Today i had bought hot reload for unity on hotreload.net, but i cannot used because that package need to registering into licensespring.com. I'm believe i didn't has any account on licensespring.
    Also while check on my unity account store, that package didn't showed on my asset.
    I need your feedback soon.
    Thank you a lot

    regards,

    Antony A

     
  28. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,140
    Unity 2021.3.29f1
    Hot Reload 1.12.5
    UniTask 2.3.1
    Rider IDE 2023.2.1

    Hi, I've experienced some issues with UniTask library. I added line 17 and got a TypeLoadException error when entering Play mode. Turning off Hot Reload doesn't help, restarting Unity with Hot Reload turned off also doesn't help initially. But if I remove the line, then fully recompile and add the line again, and fully recompile, the issue is solved with identical code. So I'm inclined to think that it's Hot Reload related.

    Code (CSharp):
    1. using System.Collections.Generic;
    2. using Cysharp.Threading.Tasks;
    3.  
    4. namespace Obscured
    5. {
    6.     public class ScenarioEngine
    7.     {
    8.         private List<CommandBase> _commands;
    9.  
    10.         public ScenarioEngine(List<CommandBase> commands)
    11.         {
    12.             _commands = commands;
    13.         }
    14.  
    15.         public async UniTask RunScenario()
    16.         {
    17.             await UniTask.NextFrame();
    18.  
    19.             foreach (CommandBase command in _commands)
    20.             {
    21.                 await command.Execute();
    22.             }
    23.         }
    24.     }
    25. }
    This is the error and it pops up whenever I add the line and try to enter Play mode with Hot Reload turned on.

    Code (CSharp):
    1. TypeLoadException: Could not resolve type with token 0100000b from typeref (expected class 'CommandBase' in assembly '')
    2. Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at Library/PackageCache/com.cysharp.unitask@f48cb4b03e/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs:111)
    3. ...
     
    Last edited: Aug 31, 2023
  29. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey Antony, we've responded to your email, let us know if you need further help.
     
  30. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hi. Unfortunately, we haven't found a solution to this problem yet.
    Feel free to reach out via Discord or email to discuss your use-case, there is a chance we might find a solution for you.
     
  31. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey there, it seems that Hot Reload has an issue with field closure in async context (not exclusive to UniTask lib).
    Changing `_commands` to `IList<CommandBase>` seems to work around the problem.
    We will look into making a proper fix for this issue. Thanks for reporting it!
     
    PanthenEye likes this.
  32. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    Hi there @PencilBow,

    running into a weird issue. I'm not a 100% sure its related to Hot Reload but I thought I'd ask you.

    I'm making development Mono builds and the code doesn't seem to update/recompile in the build.

    I'm 100% sure that I'm building the right scene, editing the right script, and running the correct executable.

    The code I'm changing is basically an OnGUI function on a MonoBehavior, and I'm just adding more GUILayout.Button calls and they're not showing up in the newer builds, it shows a version of the code that is a few builds old.

    NOTES:
    - If I uncheck Development build, the code updates properly, subsequent changes are reflected in rebuilds
    - If I build IL2CPP (Development or Release), the code updates properly, subsequent changes are reflected in rebuilds

    Things I tried:
    - I tried turning off the option for HR to attach to builds, it didn't help
    - I tried turning off HR completely, it didn't help
    - I tried turning off/on HR, it didn't help
    - I tried deleting temp Assembly-CSharp.dll files from HR temp folders, it didn't help
    - I tried enabling/disabling Play Mode Domain reloading options, it didn't help
    - I tried "Clean Build", it didn't help
    - Restarted Unity, regenerated project solution, it didn't help
    - Restarted Computer, it didn't help

    Something is getting cached somewhere when making Mono Development builds and I can't figure out what or where...

    Any ideas what's going on? Or if there something you could think of I could try to investigate further?
     
    Last edited: Sep 8, 2023
  33. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey, have you tried removing Hot Reload from the project (maybe that's what you meant by "turning off HR completely")?

    To investigate further, you could create a new project and try to add changes that you suspect are related to the issue.
    Once you reproduce it, remove changes one by one and test after removing each one until the issue goes away. That will tell you which change was the culprit.

    If you have a project with a reproduce, you could send it to us, and we will look into what is causing the issue.
     
  34. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    By that I meant hitting the "Stop" button on HR main window. I haven't tried completely removing HR from the project, I thought I could find it in the Package Window and remove it that way but I couldn't, I guess I just have to delete the folders.
     
  35. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Strange. Hot Reload usually shows in the Package Manager.
    Let me know what happens when you remove the package completely.
     
  36. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Hi! I would like to know is there any news about that?
     
  37. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey. We had to put field support on hold in favor of other priority fixes. We will resume work on fields in October. Sorry for the delay.
     
    eterlan likes this.
  38. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    No problem at all, hope you guys doing well!
     
    PencilBow likes this.
  39. determi_love

    determi_love

    Joined:
    Jan 4, 2021
    Posts:
    7
    Hello! I don’t know anything about how unity and IDE work together and compile behind the scenes, but I am really tired of the longer and longer compilation times, which are becoming more and more obvious in versions after 2021...

    I am considering buying hotreload. I am currently using 2022.3.6f1. This version should be considered quite new. Does hotreload support such a new version? What I mean is... How stable is hotreload for the new version of the unity editor? If hotreload is still in the process of patrolling and ironing out bugs in the 2022 version, I might wait a few months before purchasing it and adding it to my project.

    By the way, I have another question. My unity project's folder has a lot of Chinese characters. Will this cause any problems?
     
  40. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey! Hot Reload should work on later versions just as well as on earlier versions.

    You can consult troubleshooting for issues you might encounter with Chinese characters: https://hotreload.net/documentation/troubleshooting#watchman-process-ran-into-an-error.

    I advise you to try Hot Reload for free. You can download it from our website and use the one-month free trial to evaluate: https://hotreload.net/download. Feel free to let us know about any issue you encounter during the free trial.
     
  41. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Connot recommand it more, you can easily find recommandation video on bilibili.
     
    PencilBow likes this.
  42. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    Hit @PencilBow, do you have callbacks for when a hot reload begins/finishes?

    I'm generating code to initialize some data, and would like to wait for HR to finish compiling after the code is generated before I can use the generated code.
     
  43. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey, the `InvokeOnHotReload` attribute is what you're looking for. Hot Reload will invoke a method with this attribute whenever a reload finishes.
     
    Last edited: Sep 29, 2023
    DTAli likes this.
  44. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    Thanks that seems to work. However I noticed something interesting, HR doesn't recompile files if comments in them change? Is there a way to manually invoke a patch/reload?

    It makes sense that it doesn't for comments, but in my case I'd prefer if it did (the generated file has a new timestamp every time to force Unity to recompile it if HR was off)

    EDIT: This is probably too nitpicky. I can just generate the timestamp as function to force it to patch the code.
     
    Last edited: Sep 29, 2023
    PencilBow likes this.
  45. tofwtofw

    tofwtofw

    Joined:
    Nov 12, 2019
    Posts:
    2
    Hi! It doesn't update code. Tried different watchers. upload_2023-10-11_12-19-41.png
     
  46. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey, I would suggest killing `watchman` process in the Task Manager and restarting Unity project/Hot Reload.
     
  47. tofwtofw

    tofwtofw

    Joined:
    Nov 12, 2019
    Posts:
    2
    I already tried this, it didn't help.
     
  48. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
  49. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey everyone!

    We just released version 1.12.6.

    Fixes:
    • Fixed a few rare crashes
    • Significantly reduced occurrences of patch failures not being reported
    • Fixed an issue with added unity event functions causing proxy components to be added to prefabs
    Improvements:
    • Updated the interface with a list of applied patches and more detailed information on patch failures
    • Added a recompile button
    • Added support for tiny window size
     
  50. PencilBow

    PencilBow

    Joined:
    Jun 23, 2017
    Posts:
    141
    Hey, everyone

    Hot Reload was nominated for the "Best Development Tool" Unity Award.


    Your support and feedback helped us get where we are. Thank you for being a part of this!

    You can vote here: https://awards.unity.com/#best-development-tool
     
    eterlan, yeyekopi and Koara92 like this.