dotnet run fails with "Unhandled exception" when paket manages the dependencies
Nobody has claimed this yet.
- 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
mkdir solutionandcd solution.mkdir demoandcd demo.dotnet new console -lang F#. At this moment if I rundotnet runeverything goes fine.cd ..\to the solution directory andmkdir .paket. Download and copypaket.bootstrap.exeand rename it topaket.exeas the official tutorial instructs.- Create
paket.dependenciesand add the following:
source https://api.nuget.org/v3/index.json
nuget log4net
cd demoto the project directory and createpaket.referenceswith contentlog4net. In factlog4netis only referenced in the project but never ever used not even opened.cd ..to the solution directory and run.paket\paket install.cd demoanddotnet restore.dotnet runand 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 showsPaket 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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