fsprojects / fsprojects/Paket

dotnet run fails with "Unhandled exception" when paket manages the dependencies

Open
#3,519 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs triage
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

A simple .Net Core 2.2 console app fails to run when paket is added. The failure is:

Unhandled Exception:
   Cannot print exception string because Exception.ToString() failed.
Repro steps
  1. mkdir solution and cd solution.
  2. mkdir demo and cd demo.
  3. dotnet new console -lang F#. At this moment if I run dotnet run everything goes fine.
  4. cd ..\ to the solution directory and mkdir .paket. Download and copy paket.bootstrap.exe and rename it to paket.exe as the official tutorial instructs.
  5. Create paket.dependencies and add the following:
source https://api.nuget.org/v3/index.json
nuget log4net
  1. cd demo to the project directory and create paket.references with content log4net. In fact log4net is only referenced in the project but never ever used not even opened.
  2. cd .. to the solution directory and run .paket\paket install.
  3. cd demo and dotnet restore.
  4. dotnet run and see the exception pops up.

Restarting from the very first step, create a new project with dotnet new console -lang F#, dotnet add package log4net, and dotnet run, it runs with no problem and prints the "Hello world" message.

Environment
  • Windows 10 64bit
  • dotnet --list-sdks: 2.2.104 [C:\Program Files\dotnet\sdk]
  • When running .paket\paket install, it shows Paket version 5.198.0
Expected behavior

Prints "Hello world" message.

Actual behavior

Throw an exception.

Known workarounds

N/A

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the listed dotnet new console -lang F# steps, paket.dependencies, paket.references, .paket\paket install, dotnet restore, and dotnet run commands. Compare it with the working dotnet add package log4net path, then trace the Paket-managed dependency setup. Done means the Paket setup runs and prints "Hello world" without the unhandled exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.