title: dotnet pack - error MSB3644: The reference assemblies for .NETFramework,Version=v3.5 were not found
body: <p>I have a legacy project that is targeting .Net 3.5, i.e. <code>&lt;TargetFramework&gt;net35&lt;/TargetFramework&gt;</code>, this project was building fine on my build server even after upgrading the csproj to SDK style.</p>
  <p>I now want to package it as NuGet package so I have added this command to my build script:</p>
  <pre><code>dotnet pack MyProject.csproj -p:PackageVersion=1.2.3-build.4 --no-build --output .\nupkgs --configuration=Release
  </code></pre>
  <p>However this command is now failing my build with:
  <code>error MSB3644: The reference assemblies for .NETFramework,Version=v3.5 were not found</code></p>
  <p>Note that the MSBuild task preceding it works absolutely fine, it's just the <code>dotnet pack</code> that fails, I so I find it hard to believe it's an issue with missing .Net 3.5 SDK, nerveless I have double checked and the 3.5 development tools are present on the build agent, I can also see <code>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5</code> folder present on the same machine.</p>
  <p>I have tried adding a package reference to <a href="https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies/1.0.0" rel="nofollow noreferrer">Microsoft.NETFramework.ReferenceAssemblies</a> but to no avail.</p>
  <p>Does anyone have any suggestions on how to solve this?</p>