Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Several Visual Studio projects are complaining that a temp file is missing and therefore cannot be opened. Error code &H80070003

I'm running Visual Studio 2010 on a terminal server, and have been, with relatively few problems, for some time. This morning I fired up my PC and over the UK's long weekend, the following issue seems to have developed.

I've got a bunch of projects (but not all of my projects, and not all of the projects in a given solution) complaining that a particular file (which does not exist on the computer) cannot be opened, and so those projects will not compile anymore. Here's the error:

Error   31  Unable to open module file
'C:\Users\[username]\AppData\Local\Temp\2\.NETFramework,Version=v4.0.AssemblyAttributes.vb':
System Error &H80070003&

I could simply copy the file into that directory and be done with it, I'm pretty sure that will work, but I would appreciate any insight anyone can give me into why this problem has occurred, and what I can do to avoid having it happen in the future.

EDIT: Okay, now things have gotten to a whole new level of weird. I've rebooted the server, I get the same error message, only now the file it is asking for exists and can be opened in Visual Studio with no problems.

And yet, another part of the IDE still insists that it's unable to open the module file...

EDIT 2: Can't delete the file because it claims to be open in another program, but I've logged off and logged on again, and there shouldn't be anything accessing it.

EDIT 3: Because there's a wall of comments below his answer, I'll mention here that Jared's suggestion to delete the SUO file for the solutions having the problem (not files specifically to do with any of the problem projects, strangely) was what solved this, eventually.

like image 456
Frosty840 Avatar asked May 31 '11 14:05

Frosty840


1 Answers

If you've verified the file doesn't exist and are still getting that message the most likely answer is that the permissions on that directory don't allow your user account to write to them. Try creating a file in that directory and see if it succeeds. If it doesn't then you know this is the problem and you will need to correct the permissions

From "Edit 3" above and the comments below: the solution to this problem was to delete the *.SUO file from disk and open the solution again.

like image 133
JaredPar Avatar answered Oct 19 '22 17:10

JaredPar