Visual Studio 2010 “cannot find” C:\Users\[USERNAME]\AppData\Local\Temp\1\.NETFramework,Version=v4.0.AssemblyAttributes.vb after every reboot

visual studio 2010

I recently added some of my Visual Studio 2010 projects to a solution, and now every time I reopen the program they stop compiling. They complain "Unable to open module file C:\Users[USERNAME]\AppData\Local\Temp\1.NETFramework,Version=v4.0.AssemblyAttributes.vb. System cannot find the file specified." I've checked, the file exists and is accessible from the VS Editor itself!

All the information about this error I've found recommends using rebuild to work around the issue. That works for me, but I would rather not have to run a rebuild the first time I open every one of my solutions! Is there someway to avoid this error?

Best Answer

Yes, this is a problem caused by Remote Desktop Connections. RDC is (by default) setup to use create a new directory each time you log in remotely. Also, it's setup (separate setting) to delete that directory once you log off. The real solution is to remove these two settings so that it will just use your standard Temp folder, not deleting the files at logout.

There are also two workarounds to this problem:

  1. Workaround 1: Delete your .suo file for the solution before opening the solution or rebuilding.
  2. Workaround 2: Use the "Rebuild All" option for the fix

Note: Setting up RDC can really only be done if you're logged on as an administrator on the box, thus, the two workarounds.