title: Error Reading Resource File for any WPF Project in VS2012
body: <p>Whenever I try to compile any WPF project in VS2012 I have the following compile error:</p>
  
  <blockquote>
    <p>Error reading resource file 'c:\Users\mysuerID\Documents\Visual Studio
    2012\Projects\MyAppNAme\MyAppNAme\obj\Debug\' -- 'The system cannot
    find the path specified. '    C:\Users\mysuerID\Documents\Visual Studio
    2012\Projects\MyAppNAme\MyAppNAme\CSC MyAppNAme</p>
  </blockquote>
  
  <p>The problem is when VS generates the CSC command it contains an extra partial duplicated /resource parameter like this: </p>
  
  <pre><code>/resource:obj\Debug\ /resource:obj\Debug\MyAppName.Properties.Resources.resources 
  </code></pre>
  
  <p>CSC looks only at the first parameter and since no file name is specified it throws the error. I went to command line mode and tested with and without the extra parameter and verified it is the problem. I don't want to have to manually compile my projects!</p>
  
  <p>Anyone know how VS comes up with these parameters and how I could get rid of this extra invalid parameter? </p>
  
  <p>The Build Output Looks Like this (Framework 4.5)</p>
  
  <pre><code>1&gt;Target "MainResourcesGeneration" in file "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets" from project "C:\Users\jws15592\Documents\Visual Studio 2012\Projects\MyAppName\MyAppName\MyAppName.csproj" (target "PrepareResources" depends on it):
  1&gt;Building target "MainResourcesGeneration" completely.
  1&gt;Input file "C:\Users\jws15592\Documents\Visual Studio 2012\Projects\MyAppName\MyAppName\obj\Debug\MainWindow.baml" is newer than output file "obj\Debug\".
  1&gt;Task "Message" skipped, due to false condition; ('$(MSBuildTargetsVerbose)'=='true') was evaluated as (''=='true').
  1&gt;Using "ResourcesGenerator" task from assembly "PresentationBuildTasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
  1&gt;Task "ResourcesGenerator"
  1&gt;  
  1&gt;  
  1&gt;  Microsoft (R) Build Task 'ResourcesGenerator' Version '4.0.30319.17929 built by: FX45RTMREL'.
  1&gt;  Copyright (C) Microsoft Corporation 2005. All rights reserved.
  1&gt;  
  1&gt;  
  1&gt;  Generating .resources file: 'obj\Debug\'...
  1&gt;C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets(709,5): error RG1000: Unknown build error, 'Could not find a part of the path 'C:\Users\jws15592\Documents\Visual Studio 2012\Projects\MyAppName\MyAppName\obj\Debug\'.' 
  1&gt;Done executing task "ResourcesGenerator" -- FAILED.
  1&gt;Done building target "MainResourcesGeneration" in project "MyAppName.csproj" -- FAILED.
  </code></pre>
  
  <p>The ItemGroup in the Project File:</p>
  
  <pre><code>  &lt;ItemGroup&gt;
      &lt;Compile Include="Properties\AssemblyInfo.cs"&gt;
        &lt;SubType&gt;Code&lt;/SubType&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="Properties\Resources.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DesignTime&gt;True&lt;/DesignTime&gt;
        &lt;DependentUpon&gt;Resources.resx&lt;/DependentUpon&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="Properties\Settings.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DependentUpon&gt;Settings.settings&lt;/DependentUpon&gt;
        &lt;DesignTimeSharedInput&gt;True&lt;/DesignTimeSharedInput&gt;
      &lt;/Compile&gt;
      &lt;EmbeddedResource Include="Properties\Resources.resx"&gt;
        &lt;Generator&gt;ResXFileCodeGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Resources.Designer.cs&lt;/LastGenOutput&gt;
      &lt;/EmbeddedResource&gt;
      &lt;None Include="app.config" /&gt;
      &lt;None Include="Properties\Settings.settings"&gt;
        &lt;Generator&gt;SettingsSingleFileGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Settings.Designer.cs&lt;/LastGenOutput&gt;
      &lt;/None&gt;
      &lt;AppDesigner Include="Properties\" /&gt;
    &lt;/ItemGroup&gt;
  </code></pre>