I get a recurring error in Unity that looks like this:
(Screen cropped because the other elements of Unity should not have a bearing on this error message)
About my Unity:
(Using a slightly older version because the course I am taking calls for it right now)
About my computer:
Asus Laptop, Windows 8.1 64Bit
Steps to recreate the problem:
This happens from project to project. It usually happens after I write some new code in one of my scripts (but not every single time) and then try to run my game.
What I have tried so far:
- Temporarily disabling the Real-Time scanning on my Antivirus.
- Making sure my firewall is set to allow Unity and Monodevelop to run without interference.
- Changing the settings so that Unity always runs as Admin.
So far, none of these techniques have worked. The only thing I can do is close Unity and Monodevelop, wait a few minutes, and then open them again and code until the problem inevitably happens again. If anyone out there has a solution for this, please help. Thank you!
It seems as though disabling the real time scanning on Antivirus finally worked. I’m not sure why it didn’t work for me the first time. However I wonder if there’s a better solution out there as I don’t want to leave Real Time Scanning disabled forever. Thanks for the help
Two other things that I’ve found that work (other than disabling AV and restarting Unity):
-
if you know which file you edited in MonoDevelop, make a minor change to it and re-save. This seems to cause the .dll to be rebuilt, and Unity can usually read it when you toggle back. Usually you have to do more than just add whitespace, so sometimes I’ll just delete a semicolon, save the file, put the semicolon back and save again.
-
if that doesn’t work, and assuming you have your Unity project organised well, you can right-click on your Scripts folder and choose Reimport (not Refresh). It takes a little time to re-import all the scripts, but it’s still faster and less disruptive than restarting Unity.
Basically, anything that triggers the .dll to be rebuilt has a chance of letting Unity access it afterwards.