Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializing project system triggers incorrect restore prompt and reprocesses projects multiple times #141

Closed
natemcmaster opened this issue Apr 5, 2016 · 5 comments
Assignees

Comments

@natemcmaster
Copy link

Repro step

Clone entity framework to Mac.
From command line: dotnet restore (should succeed)
Open VS Code.
Select the whole "solution" in "Omnisharp: Select Project".

Expected behavior

Initialize project state and intellisense. No restore necessary.

Actual behavior

VS Code produces dozens of errors "There are unresolved dependencies from '(project)'. Please execute the restore command to continue." This is produce multiple times per project.

Furthermore, the Omnisharp output shows it is continually processing the same projects over and over. Appears to have processed each project state about 40 times.

Full log:
omnisharp-log.txt

After about ~4 minutes, project initialization appears done and omnisharp operates as expected.

My setup

VS Code 0.10.11
Using C# 0.3.7
Using omnisharp-roslyn build locally from OmniSharp/omnisharp-roslyn@aab690c (result of mergeing OmniSharp/omnisharp-roslyn#501)

@gregg-miskelly
Copy link
Contributor

The version of the C# extension that you have isn't really meant to work with .NET CLI. You can build the dev branch if you want something that should work.

@troydai
Copy link
Contributor

troydai commented Apr 5, 2016

@gregg-miskelly I believe @natemcmaster is indeed use the OmniSharp-Roslyn build from dev branch.

The problem here is the effect of combination of omnisharp-roslyn's relentless restore effort and VS Code's notification mode. Here's what happened. When O# loads the projects it looks at each projects' dependencies. If there are any unresolved dependencies, it triggers a dotnet restore. Once restore finishes it update the lock file which cause the O# to reload the project. If there are still unresolved dependencies, it will send message to VS Code which cause the notification.

In the case when there are a lot of unresolved projects, for example negative test case samples, there will be a lot of warning messages.

What does surprise me is that it repeatedly processes one project over and over. This should be OmniSharp-Roslyn issue.

This is indeed something we can improve.

@DustinCampbell
Copy link
Member

Reclassifying this issue. It isn't really a bug since it's working as it was implemented ages ago. However, the experience is terrible. 😄

@DustinCampbell DustinCampbell modified the milestones: 1.8, 1.9 Mar 8, 2017
@DustinCampbell DustinCampbell modified the milestones: 1.9, 1.10 Apr 11, 2017
@DustinCampbell DustinCampbell modified the milestones: 1.11, 1.10 May 25, 2017
@DustinCampbell DustinCampbell modified the milestones: 1.11, 1.12 Jun 27, 2017
@akshita31
Copy link
Contributor

VS Code version: 1.22.2
C# Extension Version: 1.14
O# version: 1.29.1

I have a solution with 10 projects. If I execute the dotnet restore before opening the solution in vscode, no 'Restore' notifications pop up. And if I dont do a dotnet restore before hand, then for each project the warning message appears only once.

@natemcmaster Can you check if the issue reproduces for the updated version of the extension as well ?

@natemcmaster
Copy link
Author

No repro anymore. A few things have changed in the project system since the days of project.json. I'm sure somewhere in the last 2 years someone already fixed this. Thanks for the follow up though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants