title: Visual Studio gone bonkers: 'The directory name is invalid' error when trying to compile
body: <p>For some very odd reason, my Visual Studio 2008, when trying to compile a C# project, tries to write the output of the executable to a directory with the same name as an executable, at least it seems that that's what the error message implies. After running Compile on any of my projects, CSC.EXE reports the following compiler error:</p>
  
  <blockquote>
    <p><em>Could not write to output file
    'D:\Projects\Examples\StringBuilderVsString\obj\Release\StringBuilderVsString.exe'
    -- 'The directory name is invalid. '</em></p>
  </blockquote>
  
  <p>When I look inside <code>obj\Release</code> or <code>obj\Debug</code> all intermediate resources, like StringBuilderVsString.pdb are correctly written in that directory. There are no spaces in the directory. The error happens also when running csc.exe from the command prompt.</p>
  
  <p>When running Process Monitor, I only see SUCCESS for files accessed by csc.exe and I don't see any querying or writing to locations that do no exist. </p>
  
  <p>Any ideas on tackling this are welcome.</p>