Closed beyon closed 5 months ago
Thank you for a good repro! I've had this happen so often but difficult to see it repro it was difficult to find time to try to fix it.
I added https://github.com/ionide/FsAutoComplete/pull/1248 a bit ago to help diagnose this and I end up with:
C:\Program Files\dotnet\sdk\8.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1004: Assets file 'C:\Users\jimmy.packagemanagement\nuget\Projects\251972--31cbe924-5124-4242-968f-17358f43591c\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [C:\Users\jimmy.packagemanagement\nuget\Projects\251972--31cbe924-5124-4242-968f-17358f43591c\Project.fsproj]F#
I'm guessing there's some restore not happening on F# Compiler Service side, probably can't handle parallel requests.
@TheAngryByrd I'm glad that my repro was helpful and great work in solving the issue so quickly!
Describe the bug
When opening workspaces with .fsx files open in VS Code I often get
for packages referenced with
Running the
Developer: Reload Window
command from the Command Palette can make the error go away after one or more attempts.I just noticed that having multiple (as little as two) different .fsx files open in split editor (both files visible at the same time) makes it much more frequent, to the point of one file/editor causing an error almost every time. Not entirely sure I was seeing the same issue without split editor, I thought I was but it seems hard to reproduce so could be I'm just imagining.
Steps to reproduce
Create two .fsx files both referencing some nuget packages.
View: Split Editor
command from Command Palette or keyboard shortcut Arrange so both files are open/visible at the same time in the different halves of the editor.Developer: Reload Window
command from the Command Palette (or close and restart VS Code opening the same workspace) On my machine one of the files will fail to resolve the dependency (almost?) every time.Expected behavior
Dependencies resolving for script files upon starting VS Code (or reloading window) even if multiple editors and files are open.
Workaround
Make sure only one .fsx file is open and visible in workspace. Reload window until it works.
Machine infos