- Home /
Source file could not be found - Unity 2018.2
I upgraded to Unity 2018.2. Since then I can not debug anymore. The reason for this is, that the visual studio project lists files, that are not available on the hard drive. The errors look like this: Do you have any Idea, how I can get rid of these errors? In the Editor Console everything looks fine, the scene is completly playable.
This is a showstopper for 2018.2 users. I cannot use the VS (15.7.5) debugger with Unity 2018.2 at all because of this.
Answer by ditzel · Jul 13, 2018 at 02:38 PM
If anymobdy ist interested:
Go ahead close the project & Visual Studio
Delete the Temp folder in your unity project folder
Delete C:\Users[User]\AppData\Local\Microsoft\VisualStudio
Delete C:\Users[User]\AppData\Local\Microsoft\VisualStudio Services
Delete C:\Users[User]\AppData\Roaming\Microsoft Visual Studio
Restart everything
If this does not help. Repeat 1.-5. and reinstall Visual Studio.
We have the same problem but dont like this particular solution, any one have any more informaiton on this e.g. the cause for example.
To be honest, I do not like it either. I did a long research regarding this problem. I did not find anything. Thats why I used this solution. At the end it was faster, than waiting for an accurate answer.
Fair enough, we are running some tests, patching up VS, etc. will share if we find anything.
I tried all of this (including reinstalling Visual Studio) to no avail. It did not solve the problem.
Be careful, this will erase all your custom Visual Studio settings (including code style, etc.). And it didn't help me.
Answer by aGreed · Feb 22, 2019 at 04:38 PM
For me a single file was missing; which was 1 file I deleted because it was not used anywhere. When I got this error, I created the file (in my case it was a c# script) in the location where Unity was complaining about not finding it. Then the compile worked fine. After running the game in play mode I deleted the file from inside Unity and everything worked again.
Best answer for me. I had moved a single script file into a new sub-directory via File $$anonymous$$anager while Unity and VS were open and this error popped up. Copying the file back into the old directory (File $$anonymous$$anager) and then deleting the duplicate from within Unity solved it, didn't even have to enter playmode.
This didnt work for a second for me, but then I deleted the Temp folder in the project folder and recreated this supposedly file that's supposed to be there and it worked! Thanks
Best answer for me as well. Someone else had deleted the file in source control, and my copy of Unity started to complain in this way. I created an empty file in the location it wanted, it compiled fine, I deleted it again, and all worked fine. No effective change in source control. Must be some Unity edge-case bug...
Answer by YasinJavaid_ · Jan 09, 2019 at 06:37 AM
Hi i hope all of above answers may work for someone but i didn't got success on all and using mono so Visual Studio not my issue.
i solved by minimizing my project name directory means shrink my project name, no tested directories.
Like
E:\Updates\Virtual Police Dad game New Project etc.0.13_Unity.2017.4.6.f1\Virtual Police Dad game New Project etc.0.13_Unity.2017.4.6.f1\Assets\Invector-3rdPersonController\Basic Locomotion\Scripts\XInput\Plugins
to
"E:\Updates\VirtualDad\VirtualDad\Assets\Invector-3rdPersonController\Basic Locomotion\Scripts\XInput\Plugins "
try as you can shrink your directory as much you can.
Answer by Leevi00 · Aug 31, 2018 at 03:26 PM
For me running the Visual Studio Installer and using it to Update Visual Studio to the newest version worked.
This worked for us as well, simply forgot update my comment in the other solution posted.
This also worked for me. Going from VS2017 Community 15.5.1 to 15.9.13 fixed the compile issues