Search Unity

Feedback Visual Studio failing to handle file moves in Unity!

Discussion in 'Code Editors & IDEs' started by andyz, Jan 24, 2024.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,264
    Not sure if this is Microsoft's side, but if you move cs files in Unity and then switch to or open your Visual studio project it shows blank files with errors for the files you previously had open which have now moved! I guess it is missing the meta handling to track file moves outside the project like Unity?!

    An error occurred in '<MiscFiles>' while attempting to open 'Drawcs'
    The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

    Its a bit poor
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,811
    That perfectly describes Visual Studio. :D

    In any case, try finding one of @Kurt-Dekker 's posts about fixing Visual Studio issues.
     
  3. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,264
    It is not a blocking issue - just a minor annoyance as you have to close moved files and re-open. Everything else is working great!
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,664
    Pay attention to this one because Visual Studio will LOSE your work if you don't.

    I speculate that it is part of the way that VS requires the solution and project files and probably a simple attempt to cache file handles or some other Microsoftery type of thing.

    Where it can make you lose work is if you make a few changes, then save and switch back to Unity, there is an edge case that sometimes happens when your moved file is actually reverted. I don't know if this is simply a delayed write-back or what.

    It's not super-common but I've seen it perhaps a half dozen times so I always close VS if I ever move a file. That at least forces VS to reacquire the file handles.