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

Cannot add a file to a web project in 15.7 RTW #4851

Closed
cartermp opened this Issue May 7, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@cartermp
Collaborator

cartermp commented May 7, 2018

  1. Create new ASP.NET Core project
  2. Add a file to it.

Non-fatal error every time. Log:

=====================
5/7/2018 3:41:03 PM
Recoverable
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Cannot create a relationship between nodes that were created from different projects.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
   at Microsoft.Build.Construction.ProjectElementContainer.VerifyForInsertBeforeAfterFirst(ProjectElement child, ProjectElement reference)
   at Microsoft.Build.Construction.ProjectElementContainer.InsertBeforeChild(ProjectElement child, ProjectElement reference)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElements(ImmutableArray`1 elements, ProjectItemElement referenceElement, MoveAction moveAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElementsToTop(Project project, ImmutableArray`1 elements, IProjectTree target)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.<>c__DisplayClass0_0.<Move>b__0(Project project)
   at Microsoft.VisualStudio.ProjectSystem.ProjectAccessor.<OpenProjectForWriteAsync>d__6.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.VS.Input.Commands.Ordering.OrderAddItemHintReceiver.<HintedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectChangeHintSubmissionService.<>c__DisplayClass42_0.<<ProjectLockService_ReleasedWriteLockAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Cannot create a relationship between nodes that were created from different projects.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
   at Microsoft.Build.Construction.ProjectElementContainer.VerifyForInsertBeforeAfterFirst(ProjectElement child, ProjectElement reference)
   at Microsoft.Build.Construction.ProjectElementContainer.InsertBeforeChild(ProjectElement child, ProjectElement reference)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElements(ImmutableArray`1 elements, ProjectItemElement referenceElement, MoveAction moveAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElementsToTop(Project project, ImmutableArray`1 elements, IProjectTree target)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.<>c__DisplayClass0_0.<Move>b__0(Project project)
   at Microsoft.VisualStudio.ProjectSystem.ProjectAccessor.<OpenProjectForWriteAsync>d__6.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.VS.Input.Commands.Ordering.OrderAddItemHintReceiver.<HintedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectChangeHintSubmissionService.<>c__DisplayClass42_0.<<ProjectLockService_ReleasedWriteLockAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---

===================
5/7/2018 3:42:32 PM
Recoverable
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Cannot create a relationship between nodes that were created from different projects.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
   at Microsoft.Build.Construction.ProjectElementContainer.VerifyForInsertBeforeAfterFirst(ProjectElement child, ProjectElement reference)
   at Microsoft.Build.Construction.ProjectElementContainer.InsertBeforeChild(ProjectElement child, ProjectElement reference)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElements(ImmutableArray`1 elements, ProjectItemElement referenceElement, MoveAction moveAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElementsToTop(Project project, ImmutableArray`1 elements, IProjectTree target)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.<>c__DisplayClass0_0.<Move>b__0(Project project)
   at Microsoft.VisualStudio.ProjectSystem.ProjectAccessor.<OpenProjectForWriteAsync>d__6.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.VS.Input.Commands.Ordering.OrderAddItemHintReceiver.<HintedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectChangeHintSubmissionService.<>c__DisplayClass42_0.<<ProjectLockService_ReleasedWriteLockAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- 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.InvalidOperationException: Cannot create a relationship between nodes that were created from different projects.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
   at Microsoft.Build.Construction.ProjectElementContainer.VerifyForInsertBeforeAfterFirst(ProjectElement child, ProjectElement reference)
   at Microsoft.Build.Construction.ProjectElementContainer.InsertBeforeChild(ProjectElement child, ProjectElement reference)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElements(ImmutableArray`1 elements, ProjectItemElement referenceElement, MoveAction moveAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElementsToTop(Project project, ImmutableArray`1 elements, IProjectTree target)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.<>c__DisplayClass0_0.<Move>b__0(Project project)
   at Microsoft.VisualStudio.ProjectSystem.ProjectAccessor.<OpenProjectForWriteAsync>d__6.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.VS.Input.Commands.Ordering.OrderAddItemHintReceiver.<HintedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectChangeHintSubmissionService.<>c__DisplayClass42_0.<<ProjectLockService_ReleasedWriteLockAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---

===================
5/7/2018 3:42:41 PM
Recoverable
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Cannot create a relationship between nodes that were created from different projects.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
   at Microsoft.Build.Construction.ProjectElementContainer.VerifyForInsertBeforeAfterFirst(ProjectElement child, ProjectElement reference)
   at Microsoft.Build.Construction.ProjectElementContainer.InsertBeforeChild(ProjectElement child, ProjectElement reference)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElements(ImmutableArray`1 elements, ProjectItemElement referenceElement, MoveAction moveAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElementsToTop(Project project, ImmutableArray`1 elements, IProjectTree target)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.<>c__DisplayClass0_0.<Move>b__0(Project project)
   at Microsoft.VisualStudio.ProjectSystem.ProjectAccessor.<OpenProjectForWriteAsync>d__6.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.VS.Input.Commands.Ordering.OrderAddItemHintReceiver.<HintedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectChangeHintSubmissionService.<>c__DisplayClass42_0.<<ProjectLockService_ReleasedWriteLockAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- 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.InvalidOperationException: Cannot create a relationship between nodes that were created from different projects.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
   at Microsoft.Build.Construction.ProjectElementContainer.VerifyForInsertBeforeAfterFirst(ProjectElement child, ProjectElement reference)
   at Microsoft.Build.Construction.ProjectElementContainer.InsertBeforeChild(ProjectElement child, ProjectElement reference)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElements(ImmutableArray`1 elements, ProjectItemElement referenceElement, MoveAction moveAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.TryMoveElementsToTop(Project project, ImmutableArray`1 elements, IProjectTree target)
   at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelper.<>c__DisplayClass0_0.<Move>b__0(Project project)
   at Microsoft.VisualStudio.ProjectSystem.ProjectAccessor.<OpenProjectForWriteAsync>d__6.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.VS.Input.Commands.Ordering.OrderAddItemHintReceiver.<HintedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.VisualStudio.ProjectSystem.Designers.ProjectChangeHintSubmissionService.<>c__DisplayClass42_0.<<ProjectLockService_ReleasedWriteLockAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---

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

cc @TIHan

@cartermp cartermp changed the title from Cannot add a file to a web project in RTW to Cannot add a file to a web project in 15.7 RTW May 7, 2018

@TIHan

This comment has been minimized.

Contributor

TIHan commented May 7, 2018

This is bizarre. First time I've seen System.InvalidOperationException: Cannot create a relationship between nodes that were created from different projects.

@cartermp

This comment has been minimized.

Collaborator

cartermp commented May 7, 2018

Remove also doesn't seem to work from solution explorer

@cartermp

This comment has been minimized.

Collaborator

cartermp commented May 7, 2018

(Sorry for being so short here; I'm about 10 minutes from a demo)

@cartermp cartermp added this to the 15.7 milestone May 8, 2018

@TIHan

This comment has been minimized.

Contributor

TIHan commented May 8, 2018

This PR should address this issue: dotnet/project-system#3525

@cartermp

This comment has been minimized.

Collaborator

cartermp commented May 11, 2018

Fixed and going into 15.7.2.

@cartermp cartermp closed this May 11, 2018

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