title: The command "nuget pack..." exited with code 1
body: <p>I'm' trying to execute a post build event that builds a nuget package based on a .nuspec file. I'm using Visual Studio 2013. My post build event command line is:</p>
  
  <pre><code>nuget pack $(ProjectPath) -Symbols -Properties Configuration=$(ConfigurationName) -IncludeReferencedProjects
  </code></pre>
  
  <p>When I build my project, I get the following error:</p>
  
  <pre><code>The command "nuget pack C:\Users\user\Documebts\Code\BookProject\BookProject.Nuget\
  BookProject.Nuget.csproj -Symbols -Properties Configuration=Debug 
  -IncludeReferencedProjects" exited with code 1.
  </code></pre>
  
  <p>I'm not sure what's going on - I changed the Visual Studio build output to Diagnostic and found this: </p>
  
  <pre><code>&gt;Using 'BookProject.nuspec' for metadata. (TaskId:44)
  &gt;Access to the path 'C:\BookProject.1.0.3.4.nupkg' is denied. (TaskId:44)
  &gt;C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "nuget pack C:\Users\user\Documebts\Code\BookProject\BookProject.Nuget\  BookProject.Nuget.csproj -Symbols -Properties Configuration=Debug -IncludeReferencedProjects" exited with code 1.
  &gt;Done executing task "Exec" -- FAILED. (TaskId:44)
  &gt;Done building target "PostBuildEvent" in project "Miw.Mshdf.Net.Nuget.csproj" -- FAILED.: (TargetId:72)
  </code></pre>
  
  <p>If I open up a command prompt and type in the post build event command, it works fine and builds the nuget package without any problems. Any ideas?</p>