none
Executing GraphCmd.exe throws 'Collection was modified; enumeration operation may not execute' exception RRS feed

  • Question

  • Hi,

    I have a solution with 40 projects and total LOC around 2 lakh. The solution consists of maximum C# projects and few vb.NET project and C++ projects. 

    I am trying to use GraphCmd.exe of Visual Studio 2010 Ultimate edition through a process for the above solution file. The .dgql query file is created with the query for the solution. and during execution, I get an exception :

    Unhandled Exception: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
    at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
    at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
    at Microsoft.VisualStudio.GraphModel.GraphNodeCollection.Microsoft.VisualStudio.GraphModel.IEnlistableNotify.RolledBack(IIsolatorObject isolationObject)
    at Microsoft.VisualStudio.GraphModel.TransactedDictionary`2.Microsoft.VisualStudio.GraphModel.IEnlistableObject.RollbackChanges(IIsolatorObject isolationObject)
    at Microsoft.VisualStudio.GraphModel.GraphTransactionEnlistment.System.Transactions.IEnlistmentNotification.Rollback(Enlistment enlistment)
    at System.Transactions.VolatileEnlistmentAborting.EnterState(InternalEnlistment enlistment)
    at System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx)
    at System.Transactions.EnlistableStates.Timeout(InternalTransaction tx)
    at System.Transactions.Bucket.TimeoutTransactions()
    at System.Transactions.BucketSet.TimeoutTransactions()
    at System.Transactions.TransactionTable.ThreadTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.TimerQueue.FireNextTimers()

    When I run with fewer C# projects it works fine. Can anyone please help me what could be the issue?

    Regards,

    NeelAK


    Thursday, September 12, 2019 10:45 AM

Answers

  • Hi NeelAK,

    Thank you for feedback.

    Not sure if it is related to 32 bit and 64 bit, but from the official note, it would be out of memory if the solution is large. the link:

    And it seems that you need to reduce your scope or use Architecture Explorer to generate graph manually.

    Sorry for this inconvenience.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by NeelAK Wednesday, September 25, 2019 4:45 AM
    Tuesday, September 17, 2019 2:35 AM

All replies

  • Hi NeelAK,

    Welcome to MSDN forum.

    For C++ projects, you need to download and install Microsoft Visual Studio 2010 Visualization and Modeling Feature Pack. And then try to re-run GraphCmd.exe for your solution.

    If it persists, please check this doc for your process: Generate Graph Documents for Batch Processing

    Look forward to your reply.

    Best Regards,

    Dylan 


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, September 13, 2019 8:11 AM
  • Hi Dylan,

    I do not know if the issue is with C++ components.We tired running it on 2 C# projects which together make upto ~ 40-50 classes but LOC is close to 3 lakh. Not sure if the issue is with the projects with huge LOC and classes.  It threw the same error. When we reduce the size, it works fine. We are still doing our analysis. 

    For Architecture and modelling tools installation, I verified that in my VisualStudio->Help->About, I can see Microsoft Visual Studio 2010 Architecture and Modeling Tools   in the installed list. Is there something I am missing?

    What we observed is that even on 64 bit machine with 16GB RAM,  GraphCmd.exe platform is 32bit and goes upto memory ~1.5GB and then closes with that error even when the available memory is about 6GB. Is it because Visual Studio is 32 bit?

    Regards,
    NeelAK

    Monday, September 16, 2019 6:29 AM
  • Hi NeelAK,

    Thank you for feedback.

    Not sure if it is related to 32 bit and 64 bit, but from the official note, it would be out of memory if the solution is large. the link:

    And it seems that you need to reduce your scope or use Architecture Explorer to generate graph manually.

    Sorry for this inconvenience.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by NeelAK Wednesday, September 25, 2019 4:45 AM
    Tuesday, September 17, 2019 2:35 AM
  • Thank you so much Dylan,

    I get what you are saying. I will see what I can do in terms of scope. But the exception thrown is CollectionModified and I agree sometimes it throws StackOverFlow. 

    But  can you please help me understand if there is a way where I can increase the allocated memory for GraphCmd.exe? Any configuration setting? Anything as such is allowed or works? so that it can take upto 4GB.

    Looking forward for your reply

    Regards,

    NeelAK

    Tuesday, September 17, 2019 9:02 AM
  • Hi NeelAK,

    Thank you for reply.

    I'm sorry that there is no related document about configuring GraphCmd.exe. It is like msbuild.exe, so we just call it then make it work, and there is no appropriate methods to configure this tool.

    Sorry for this inconvenience.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, September 18, 2019 9:55 AM
  • Thanks Dylan
    Wednesday, September 25, 2019 4:45 AM