title: MSBuild error "CSC : error CS2001: Source File 'x' could not be found" with Linked Files after upgrading to Visual Studio 2012
body: <p>After automatically upgrading the project file for a .Net 4.0 web application to work with Visual Studio 2012 everything worked ok at first however when compiling I got lots of errors like this:</p>
  
  <blockquote>
    <p>Description : Source File '..\..\..\..\..\File Path' could not be found</p>
    
    <p>File        : CSC</p>
  </blockquote>
  
  <p>And when trying to build using MSBuild (passing just the project full path, with no additional parameters) in the "Developer Command Prompt for VS2012" I got basically the same errors:</p>
  
  <blockquote>
    <p>"CSC : error CS2001: Source File 'x' could not be found"</p>
  </blockquote>
  
  <p>All errors refer to <strong>Linked Files</strong> (aspx,cs,etc) located in other web applications projects located at a different deep in our code Branch (that's why all the '....\' at the beginning of the paths)</p>
  
  <p><strong>To me it looks like a problem with the file Length</strong>, I had the same problem a while ago when building the projects on our CI server using MSBuild, I was able to manage it by manipulating the project files before building them using a custom script without the need to move the branch around or reduce the deep of the projects, I didn't have to move anything, the important thing at the time it was that developers using Visual Studio 2010 could compile everything without problems. I learned by this that compiling/Building with MSBuild was different that with DevEnv/VS, and for example MSBuild didn't support building Setup projects and DevEnv did.</p>
  
  <p>Since this is happening now with VS 2012/DevEnv 2012 , plus that VS 2012 doesn't support setup projects anymore (like msbuild), plus VS/DevEnv have the same problem with the file length, it looks like VS 2012 its finally using msbuild under the hood or are more tightly integrated, however I didn't find any article to confirm this. </p>
  
  <p>Changing the branch structure/changing the deep of the projects it’s not an option right now due to several reasons (large code base, high number of projects, risk, timing, effort, etc.). </p>
  
  <p>Does someone have an alternative solution or a fix for this issue in Visual Studio 2012?</p>
  
  <p>Regards,</p>
  
  <p>P.D.: BTW I already checked this post <a href="https://stackoverflow.com/questions/12304645/msbuild-error-with-linked-files">MSBuild error with linked files</a> but like I said before changing the paths its not an option right now.</p>