Add ResolveNuGetPackages=false property to .fsproj
See original GitHub issueDisclaimer: this is a workaround that I’ve been suggested (and works) for a specific problem I had (described below). I don’t know about the generics and whether this is the appropriate solution for all cases. I’m reporting this issue on request 😉
I had an .fsproj file (old format) for an F# Windows/Mono .NET Framework 4.6.1 project with dependencies managed my Paket. After updating Visual Studio to 15.2 I couldn’t build the project anymore because of the following error:
error : Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore.
Note I didn’t have any project.json as this was not a netcore project. This also happened to FAKE builds as FAKE was calling
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
after VS update.
Thanks to @enricosada help, I could fix the issue by adding the following line to the project properties.
<ResolveNuGetPackages>false</ResolveNuGetPackages>
Maybe it makes sense that Paket adds this line automatically to old .fsproj files?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top GitHub Comments
It doesnt make a lot of sense. That’s an error who happen only on old fsproj if a
project.json
exists.@alfonsogarciacaro can you try
msbuild.exe the.fsproj /v:diag /p:ResolveNuGetPackages=false
msbuild.exe the.fsproj /v:diag /p:ResolveNuGetPackages=true
and save the output? i should contains some clue.
Adding that by default (for old fsproj) mean will ignore the
project.json
(used like for uwp, or anyway for package refs). dunno if has others meaning the propertyYes, this issue helps anyway, is good anyway to have a workaround here just googling.
Let’s wait for another repro, maybe is just a transitory interaction, cannot thing about anything atm.
To directly add
ResolveNuGetPackages
in paket maybe is an idea, but need to check what exacly enable/disable in all sdk (old and new). maybe can be added only for old sdk (old fsproj/csproj)? there is harmless afaik. Can be a solution @forki ?