Skip to content

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

Open
@masq6r

Description

@masq6r

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions