question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ResolveNuGetPackages=false property to .fsproj

See original GitHub issue

Disclaimer: 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:open
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
enricosadacommented, May 22, 2017

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 property

0reactions
enricosadacommented, May 25, 2017

Yes, 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 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add item to fsproj through dotnet CLI
The one thing that I can't figure out how to do is add a new compile item to the fsproj file through a...
Read more >
PackageReference in project files - NuGet
Add a dependency in your project file using the following syntax: ... are PackageReference styled (existing csproj or SDK-style projects).
Read more >
Compiler Options - F# | Microsoft Learn
Use F# compiler command-line options to control the compilation of your F# apps and libraries.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found