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.

dotnet paket fails after installing VS 2019 16.8

See original GitHub issue

Description

I’ve been using paket as a .net tool for a netcoreapp3.1 project. However, after installing the latest update to VS2019 (16.8) yesterday, I’m getting a errors when I try to run dotnet paket restore . It was working prior to this.

Repro steps

Please provide the steps required to reproduce the problem

  1. dotnet tool restore

  2. dotnet paket restore

Expected behavior

Packages should be restored without errors.

Actual behavior

Getting these errors:

Cannot use file stream for [C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any\paket.deps.json]: No such file or directory A fatal error was encountered. The library ‘hostpolicy.dll’ required to execute the application was not found in 'C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any'. Failed to run as a self-contained app.

  • The application was run as a self-contained app because ‘C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any\paket.runtimeconfig.json’ was not found.
  • If this should be a framework-dependent app, add the ‘C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any\paket.runtimeconfig.json’ file and specify the appropriate framework.

Known workarounds

The old school paket.exe approach does work for me.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DanJensencommented, Nov 13, 2020

@forki I found the problem, and it was my fault. When I run the dotnet commands directly, they work at first. But if I run our build script, one of the things it was doing was: dotnet paket clear-cache. Since we switched to using paket as a dotnet tool recently, that was actually the cause of the problem because it would essentially delete itself. Or at least all of its supporting files. And after that it wouldn’t work right. I can change my script to not do that anymore.

One question though: since using paket as a dotnet tool is the recommended approach now, is there a way to use the clear-cache option anymore? Or is that basically deprecated now?

Thanks for your help!

0reactions
DanJensencommented, Nov 16, 2020

It was caused by something I was doing, not paket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio 2019 upgrade to 16.8.2 fails
I've tried “Cancel”, with limited success. It does cancel the installation, but the upgrade does not revert to the prior version (16.8.1). So, ......
Read more >
Unable to work on new existing template Asp.net WebAPI ...
Hi, I have been trying to work on the weather forecast example with swagger in VS 2019 16.8, but when I build the...
Read more >
Visual Studio 2019 connection problem to NuGet
I reinstalled (clean) Visual Studio 2019 (Microsoft Visual Studio Community 2019 Version 16.8.5) and I get error when I try to clean ...
Read more >
Visual Studio 2019 unable to locate .Net Core SDK
Step 1) First run dotnet --list-sdks from the command line (as in Grzegorz Smulko's answer). Take note of the greatest version number.
Read more >
Paket and the .NET SDK / .NET Core CLI tools (dotnet CLI ...
Paket provides support for .NET SDK-based projects that are used with the dotnet CLI (running with .NET Core) or with MSBuild 15 (Visual...
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