After months of using Nuget Pack in PowerShell without a problem, it is suddenly failing every time.
These are the messages:
Attempting to build package from 'MyProj.fsproj'.
MSBuild auto-detection: using msbuild version '12.0' from 'C:\Program Files (x86)\MSBuild\12.0\bin'.
The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\FSharp\Microsoft.Portable.FSharp.Targets" was not found. Confirm that the path in the declaration i s correct, and that the file exists on disk. C:\GitHub\MyProj\MyProj.fsproj
I went into the fsproj
file and found these elements:
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">12</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets" />
Looking in the folder C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\FSharp
, there is indeed a file called Microsoft.Portable.FSharp.Targets
, but there is no such file in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\FSharp
.
I tried to fix this issue by editing the fsproj file, and changing MinimumVisualStudioVersion
to 14, but that did no good whatsoever.
Why is the auto-detection picking up MSBuild 12, not MSBuild 14? And more pertinently, why could this possibly have started happening after months and months of flawless builds?
I'm using the command nuget pack MyProj.fsproj -properties Configuration=Release
.