Could not write to output file error

One of the few remaining issues I continually have is this “Could not write to output file” compile error I get when I switch my configuration types. I think the majority of time it is when I switch from Debug to Release version. I don't always get it, but it happens I would say once every 3 days or so.

Then I am forced to restart Visual Studio, and it compiles like nothing was every wrong.

Has anyone else seen this?

Make a Hotkey Macro for Comments in .NET

I like having comments in the code that shows who did it and when. You can obviously get more complex, but this is good for me.

To make your own macro to look like “//SBE 06/04/2004: “, do this:

  1. Open Macro Explorer w/in VS.NET. (Tools –> Macros –> Macro Explorer)
  2. Create a function like the one below in any module. My example below uses a module called “Module1” (those are my initials BTW).
  3. Sub Comment()
    DTE.ActiveDocument.Selection.Text = "//SBE " +
    Date.Today.ToString("MM/dd/yyyy") + ": "
    End Sub
  4. Close Macro Explorer and go to Tools –> Options –> Environment –> Keyboard.
  5. Select your macro, like (Macros.MyMacros.Module1.Comment)
  6. Select “Global” or whatever you like, in “Use new shortcut in”
  7. Go To “Press shortcut key(s)” and select on your keyboard a combination. Mine is -Q. Hit “Assign”. If it is already in use, it will tell you to create your own mapping scheme. Just do it.
  8. Test it out in your code.

Update 5/19/05: For Visual Studio 2005, you will find the dialog at Tools –> Customize –> Keyboard…