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

Visual Studio 15.6 deadlocks on solution load for .NET Core SDK project when a <None Include=""> is added to file list #4300

Closed
btrepp opened this issue Feb 2, 2018 · 9 comments
Labels
Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. Regression

Comments

@btrepp
Copy link

btrepp commented Feb 2, 2018

(Edited by @cartermp to update repro steps)

15.6 crashes on load of this solution
https://github.com/btrepp/vspreviewcrash

Repro steps

  1. git clone https://github.com/btrepp/vspreviewcrash
  2. cd vspreviewcrash\dotnet
  3. .paket\paket.exe install
  4. dotnet restore
  5. Open solution file.

Expected behavior

Solution loads.

Actual behavior

A popup with "a non fatal error has occured" appears, but then VS locks up

Known workarounds

None

Related information

Operating system is windows 10, Machine had brand new windows installed and then Visual studio installed.

@cartermp
Copy link
Contributor

cartermp commented Feb 2, 2018 via email

@btrepp
Copy link
Author

btrepp commented Feb 2, 2018

That helps with the solution level crash, the IDE loads. But fails to load the project with
"The project file is incomplete. Expected imports are missing"

Its nice enough to create a log file for this. Which contains

=====================
2/02/2018 10:52:10 AM
Recoverable
System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.ProjectSystem.UpToDate.BuildUpToDateCheck.Initialize()
   at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposed.EnsureInitialized(Boolean allowInitializing)
   at Microsoft.VisualStudio.ProjectSystem.UpToDate.BuildUpToDateCheck.Load()
   at Microsoft.VisualStudio.ProjectSystem.ConfiguredProjectImpl.<>c__DisplayClass108_2.<<InitializeAsync>b__6>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass28_1.<<Fork>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.ProjectSystem.UpToDate.BuildUpToDateCheck.Initialize()
   at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposed.EnsureInitialized(Boolean allowInitializing)
   at Microsoft.VisualStudio.ProjectSystem.UpToDate.BuildUpToDateCheck.Load()
   at Microsoft.VisualStudio.ProjectSystem.ConfiguredProjectImpl.<>c__DisplayClass108_2.<<InitializeAsync>b__6>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass28_1.<<Fork>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---

===================

EDIT: Looking through that. It seems whatever 15.5.6 builds/puts in obj/ is incompatible vs 15.6 preview 3. Cleaning out obj/ by hand seems to help.

EDIT2:

git clean -fdx seems to allow it to be opened but

git clean -fdx && paket.exe install seems to generate the files that caused it to crash (things appear in obj)

@KevinRansom
Copy link
Member

@Pilchie @jmarolf

That stack looks like Project System or CPS.

@cartermp
Copy link
Contributor

cartermp commented Feb 2, 2018

Tagging as external for now, will update or close as-appropriate

@Pilchie
Copy link
Member

Pilchie commented Feb 2, 2018

Tagging @panopticoncentral - do you know how this could happen?

@panopticoncentral
Copy link

All we do in Initialize is hook up to the dataflow. Best guess is that some condition is causing one of the CPS services we expect to be there to be null. We can harden against this, but it's surprising that a service wouldn't be there. Maybe the import service since imports are mentioned above? I'll take a look in the debugger.

@cartermp cartermp changed the title Visual studio 15.6 preview 3 crashes on solution load Visual studio 15.6 crashes on solution load when wo items that refer to the same file are present Mar 6, 2018
@cartermp cartermp changed the title Visual studio 15.6 crashes on solution load when wo items that refer to the same file are present Visual studio 15.6 crashes on solution load when two items that refer to the same file are present Mar 6, 2018
@cartermp cartermp changed the title Visual studio 15.6 crashes on solution load when two items that refer to the same file are present Visual studio 15.6 deadlocks on solution load when two items that refer to the same file are present Mar 6, 2018
@cartermp cartermp changed the title Visual studio 15.6 deadlocks on solution load when two items that refer to the same file are present Visual studio 15.6 deadlocks on solution load for .NET Core SDK project when paket.references is included in the file list Mar 6, 2018
@cartermp cartermp changed the title Visual studio 15.6 deadlocks on solution load for .NET Core SDK project when paket.references is included in the file list Visual Studio 15.6 deadlocks on solution load for .NET Core SDK project when paket.references is included in the file list Mar 6, 2018
@cartermp cartermp changed the title Visual Studio 15.6 deadlocks on solution load for .NET Core SDK project when paket.references is included in the file list Visual Studio 15.6 deadlocks on solution load for .NET Core SDK project when a <None Include=""> is added to file list Mar 6, 2018
@cartermp
Copy link
Contributor

cartermp commented Mar 6, 2018

Big title/text update for tracking purposes.

Basically, if a <None Include-""> is in the set of files for compilation in a .NET Core SDK project, VS will deadlock. This is because default file globbing for the project system will pick it up anyways, and this ultimately leads to duplicate items referring to the same file.

The workaround is to apply this in the project file:

  <ItemGroup>
    <None Remove="*.*" />
  </ItemGroup>

Then the F# project files with None Include items will work just fine. A fix is underway in the project system.

@btrepp
Copy link
Author

btrepp commented Mar 7, 2018

Depending on your projects (eg I used folders). The nuclear workaround is

  <ItemGroup>
    <None Remove="**/*" />
  </ItemGroup>

Which throws all the automagic stuff in the bin and makes it so you explicitly include items. Adding this everywhere brought my solution back to being use-able.

@cartermp cartermp added Regression Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. labels Mar 8, 2018
@cartermp
Copy link
Contributor

cartermp commented Mar 9, 2018

The fix for this has been merged in and will be available in a servicing release for 15.6 soon.

@cartermp cartermp closed this as completed Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. Regression
Projects
None yet
Development

No branches or pull requests

5 participants