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

UpgradeProject crashes IDE with "Unable to check out the files from source control" #18199

Closed
jcouv opened this issue Mar 27, 2017 · 13 comments
Closed
Labels
Area-IDE Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner.
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Mar 27, 2017

I’m getting a crash when using the UpgradeProject fixer.
It comes from void EnsureEditableDocuments(IEnumerable<DocumentId> documents)

The input is a single document, which apparently has a null path.

I see a few possible interpretations, but I don’t know what’s the proper expectations:

  1. We should not be checking this document in the first place
  2. We should check this document, but it should have a path
  3. It’s ok for the check to fail, but the exception should not blow up the IDE

I have a repro project and a minidump if needed.

[0] = (DocumentId, #15fef80d-55d3-442e-91f5-88ec51476497 - C:\Users\jcouv\AppData\Local\Temp\.NETFramework,Version=v4.6.AssemblyAttributes.cs)

The result from QueryEditFiles is -2147467261.

> Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.EnsureEditableDocuments(System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.DocumentId> documents) Line 1111    C#
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.EnsureEditableDocuments(Microsoft.CodeAnalysis.DocumentId[] documents) Line 1123    C#
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.ApplyDocumentTextChanged(Microsoft.CodeAnalysis.DocumentId documentId, Microsoft.CodeAnalysis.Text.SourceText newText) Line 855                C#
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Workspace.ApplyChangedDocument(Microsoft.CodeAnalysis.ProjectChanges projectChanges, Microsoft.CodeAnalysis.DocumentId documentId) Line 1335       C#
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Workspace.ApplyProjectChanges(Microsoft.CodeAnalysis.ProjectChanges projectChanges) Line 1283           C#
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Workspace.TryApplyChanges(Microsoft.CodeAnalysis.Solution newSolution, Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker) Line 1075             C#
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.TryApplyChanges(Microsoft.CodeAnalysis.Solution newSolution, Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker) Line 169               C#
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.CodeActions.ApplyChangesOperation.TryApply(Microsoft.CodeAnalysis.Workspace workspace, Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker, System.Threading.CancellationToken cancellationToken) Line 44 C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ProcessOperations(Microsoft.CodeAnalysis.Workspace workspace, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CodeActions.CodeActionOperation> operations, Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker, System.Threading.CancellationToken cancellationToken) Line 258              C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ApplyAsync(Microsoft.CodeAnalysis.Workspace workspace, Microsoft.CodeAnalysis.Document fromDocument, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CodeActions.CodeActionOperation> operations, string title, Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker, System.Threading.CancellationToken cancellationToken) Line 164              C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeWorker(System.Func<Microsoft.CodeAnalysis.Document> getFromDocument, Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker, System.Threading.CancellationToken cancellationToken) Line 164              C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeCore.AnonymousMethod__0() Line 133                C#
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformAction(Microsoft.CodeAnalysis.Extensions.IExtensionManager extensionManager, object extension, System.Action action) Line 22           C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeCore(System.Func<Microsoft.CodeAnalysis.Document> getFromDocument, Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker, System.Threading.CancellationToken cancellationToken) Line 131              C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InnerInvoke(Microsoft.CodeAnalysis.Shared.Utilities.IProgressTracker progressTracker, System.Threading.CancellationToken cancellationToken) Line 121           C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.Invoke.AnonymousMethod__0(Microsoft.CodeAnalysis.Editor.Host.IWaitContext waitContext) Line 107     C#
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.VisualStudioWaitIndicator.Wait(string title, string message, bool allowCancel, bool showProgress, System.Action<Microsoft.CodeAnalysis.Editor.Host.IWaitContext> action) Line 43               C#
Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.Invoke(System.Threading.CancellationToken cancellationToken) Line 103         C#
               [External Code] 

@Pilchie
Copy link
Member

Pilchie commented Mar 27, 2017

@jcouv What edit is being made to that file? I wouldn't expect a change there.

@jcouv
Copy link
Member Author

jcouv commented Mar 27, 2017

I wouldn't expect that file to be editted in any way. I'm not even sure what that file is.
I just open the project (which has a few libraries, targeting different frameworks), use a C# 7.1 feature (default literal) and trigger the UpgradeProject fixer. I'd expect only the csproj files to be touched.

@Pilchie
Copy link
Member

Pilchie commented Mar 27, 2017

@jasonmalinowski - what are your thoughts here?

@jasonmalinowski
Copy link
Member

@Pilchie: I would think we shouldn't crash? 😄

@jcouv: when you build a project the runtime wants to have an assembly level attribute defined that will say what framework you were targeting. This allows for various things to be done, like identifying if a given assembly can run on a given framework, maybe using it to know which backcompat shims to apply, etc. (This mechanism is less meaningful these days, but whatever.) Since frameworks are a figment of the imagination from the perspective of the compiler, there are MSBuild targets that generate these files that get included as an input to the compiler that you don't see in your project file. You'll see them on the command line though being passed in. They're files that are in temp and are never editable and should never be changed, so it's very odd you're seeing an effort to ensure they're editable in the first place.

@Pilchie
Copy link
Member

Pilchie commented Mar 29, 2017

@jcouv Can you start by looking at the new solution and seeing why it thinks there are edits to that file?

@Pilchie Pilchie added this to the 15.3 milestone Mar 29, 2017
@jcouv
Copy link
Member Author

jcouv commented Mar 31, 2017

I wasn't able to repro live any more, so I looked at the dump. But I couldn't trace back further than the part that has new project and old project (I don't have dump information for the logic that produced the new project).
I'll re-open if I run into this again.

@jcouv jcouv closed this as completed Mar 31, 2017
@jcouv jcouv added the Resolution-Not Reproducible The described behavior could not be reproduced by developers label Mar 31, 2017
@jcouv
Copy link
Member Author

jcouv commented Jul 1, 2017

I just ran into this again (twice). I saved a new dump file on my share (jcouvdev look for this bug's number), in the EnsureEditableDocuments method.

@jcouv jcouv reopened this Jul 1, 2017
@jcouv jcouv removed the Resolution-Not Reproducible The described behavior could not be reproduced by developers label Jul 1, 2017
@jcouv jcouv removed their assignment Jul 1, 2017
@jcouv jcouv modified the milestones: 15.5, 15.3 Jul 1, 2017
@Pilchie Pilchie removed this from the 15.5 milestone Aug 9, 2017
@Pilchie Pilchie added this to the 15.5 milestone Aug 9, 2017
@dpoeschl dpoeschl modified the milestones: 15.5, 15.later Sep 21, 2017
@dpoeschl dpoeschl added the Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner. label Sep 21, 2017
@jinujoseph jinujoseph modified the milestones: 15.6, Unknown Nov 3, 2017
@mario-d-s
Copy link

mario-d-s commented Mar 21, 2018

I found this issue through Google so I'm not sure if this is the correct place to report, but I'm experiencing the exact same problem.

Trying to use default literal and upgrade all C# projects to latest via alt+enter.

Since the error mentions source control - the repo is in SVN and I use Ankh SVN as a Source Control plugin.

I would be happy to provide any extra info but I don't know where to look. ActivityLog.xml has nothing interesting (it's on Verbose).

@Neme12
Copy link
Contributor

Neme12 commented Apr 2, 2018

I'm getting this every now and then when trying out #25875 but not consistently. The solution only has 1 project and is not in source control.

@jasonmalinowski
Copy link
Member

@ivanbasov I'd say there's a pretty good likelihood these are the same.

@jinujoseph jinujoseph modified the milestones: 15.7, 15.8 May 1, 2018
@JieCarolHu JieCarolHu added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels May 2, 2018
@StuartQ
Copy link

StuartQ commented May 25, 2018

@JieCarolHu I'm currently seeing this in VS 15.7.2. Can you advise when this fix will be available?

@Neme12
Copy link
Contributor

Neme12 commented May 25, 2018

@StuartQ The fix should be available in 15.8 Preview 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner.
Projects
None yet
Development

No branches or pull requests

10 participants