Jun28Written by:Will
6/28/2007

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 correct the error.
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!
6 comment(s) so far...
if it is a build issue with the .pdb -> open it in notepad
it will list the directory it is choking on
By Rob K on
2/25/2009 |
Great tip! I will have to try that the next time this happens. So far, it hasn't happened since I post this. :)
By Will on
2/25/2009 |
The tip was really helpful. I did notice that it was having problem with loading a file. I removed that file from the project in notepad and it got resolved.
Thanks.
By Praba on
8/24/2009 |
This worked perfectly fine, my default.aspx.vb file was missing which was created by default and I just remove the .aspx file.
By vishal on
3/8/2010 |
Great! This helped a lot and saved me sleepless nights!! :)
By Ama on
4/27/2010 |
Thanks guys. I had the same issue and this worked fine. thankx
By Mthuthuzeli on
8/27/2010 |