Will "the Mighty" Strohl

Visual Studio Error: Unable to write to output file...

If your Visual Studio crashes as much as mine does, you have invariably ran into an error stating "Unable to write to output file [filepathandname]: Unspecified error".  At first, this error really ticked me off, as it left me with no path to troubleshoot and/or correct the error.

The problem?

Now let me digress to the behavior that occurred just prior to the error...  Although I am running on a relatively clean install of Windows XP (not upgrading to Vista anytime in the near future), and Visual Studio 2005, i have many instances where Visual Studio 2005 will freeze for seemingly no reason.  Sometimes, whatever is holding it up will clear out and I can get back to work.  Other times, I have to force it to close through Task Manager.

Just before this error occurs, Visual Studio would have frozen and closed either due to it capturing an error, or because I had no choice but to close it.  When I reopen it and attempt to build a project or solution, it will sometimes return this error.

Unable to write to output file [FILENAME]: Unspecified error

If you attempt to rebuild instead of build, it will do nothing.  You can close and reopen the program... No dice.  Since it kind of sounds like a permissions error, you could check the permissions throughout your system.  It won't help.  You can do the unthinkable and reboot your machine and this error will not go away.

The cause?

So...  What caused it?  Why is this happening to me (you)?

This problem is there due to Visual Studio not being able to resolve the location of a file that is supposed to be in your project.  Either the folder name or file name changed and Visual Studio cannot find it.

This happens to me most often when the freeze occurs while I am moving or renaming files in my project (folders too).

The solution?

First, make sure that your project is allowing you to see files that are not "included" in your project. 

Second, look through your folders and find any files with an exclamation point before the filename.  Fix the missing or renamed file problem.  Normally this involves restoring the previous file name or moving files back into the old directory.  Try rebuilding and you should be fine!

blog comments powered by Disqus