title: Website publish failing due to file path being too long
body: <p>I am trying to publish a Website project from a vendor that has ridiculously long paths to some of its files. When publishing, the error is:</p>
  
  <pre><code>The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
  </code></pre>
  
  <p>When I publish, Visual Studio 2012 Update 3 is attempting to write to a temp directory, and the prefix is quite long:</p>
  
  <pre><code> C:\Users\cuser\AppData\Local\Temp\WebSitePublish\MidasCMS400v9-1580334405\obj\Debug\Package\PackageTmp\
  </code></pre>
  
  <p>I thought I might be able to redirect VS to a different temporary directory at <code>c:\tem</code> by following this SO answer: <a href="https://stackoverflow.com/questions/16526022/temp-path-too-long-when-publishing-a-web-site-project">Temp path too long when publishing a web site project</a></p>
  
  <p>I create my publication profile, and as soon as I open it, there is an error indicating that <code>WebPublishMethod</code> is not an element of <code>PropertyGroup</code>. Regardless, I updated the file so it looks like this:</p>
  
  <pre><code>&lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup&gt;
      &lt;WebPublishMethod&gt;FileSystem&lt;/WebPublishMethod&gt;
      &lt;LastUsedBuildConfiguration&gt;Debug&lt;/LastUsedBuildConfiguration&gt;
      &lt;LastUsedPlatform&gt;Any CPU&lt;/LastUsedPlatform&gt;
      &lt;SiteUrlToLaunchAfterPublish /&gt;
      &lt;ExcludeApp_Data&gt;False&lt;/ExcludeApp_Data&gt;
      &lt;publishUrl&gt;C:\Sites\MidasPublish&lt;/publishUrl&gt;
      &lt;DeleteExistingFiles&gt;False&lt;/DeleteExistingFiles&gt;
      &lt;AspnetCompileMergeIntermediateOutputPath&gt;c:\tem\&lt;/AspnetCompileMergeIntermediateOutputPath&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>When I try to publish, I get the a modal box pop-up entitled "File Modification Detected", with the message "The project YourWebsite has been modified outside the environment", and it asks me if I want to reload. In my error list, I continue to get the error about the path being too long, as it is not attempting to use the <code>c:\tem</code> directory I identified.</p>
  
  <p>I need to put this bloody thing onto a server, I am up for any solution that allows me to publish the bloody thing. I don't know much about the Website project template, so please let me know if there is a better way.</p>