Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

A .NET Framework error occurred during execution of user-defined routine or aggregate 'GetAssignedUsers'

Posted on by 5

I am receiving an error on our Microsoft Dynamics  Great Plains 2015 that is as follows

[Microsoft][SQL Server Native Client 11.0][SQL Server]A .NET Framework error occured during execution of user-defined routine or aggregate 'GetAssignedUsers": System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\devsrv\app[ 

The rest of the message has been truncated. This error occurs when a user does several things in GP: navigate menu to a different PO the error appears for only certain PO in the finance module from within the Purchase Order Entry screen.

I am an engineer of 14 years so feel free to be as detailed as possible.

Side note, I am unable to get DynamicsWebServicesExceptionsConsole to work and would appreciate some good information on how I can get a better look at the exception occurring. I am unable to see the exception in Event Viewer.

Thanks!

  • James McCullough Profile Picture
    James McCullough 294 on at
    RE: A .NET Framework error occurred during execution of user-defined routine or aggregate 'GetAssignedUsers'

    <necrobump>

    Thank you Derek, this was the exact solution for one of my clients.  This happened during the same time that Microsoft has put out a bad ODBC driver update, but your answer worked.  I wanted to put that here in case someone else sees this error and the recommended solution from MS didn't work.

    -J

  • KellyanneB Profile Picture
    KellyanneB 15 on at
    RE: A .NET Framework error occurred during execution of user-defined routine or aggregate 'GetAssignedUsers'

    Here are the drop scripts for GP 2018 to run before the exec script if it doesn't work by itself:

    IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'GetAssignedUsers')

           DROP PROCEDURE [GetAssignedUsers];

         IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'SendWorkflowAssignmentEmail')

           DROP PROCEDURE [SendWorkflowAssignmentEmail];

         IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'SendWorkflowCompletionEmail')

           DROP PROCEDURE [SendWorkflowCompletionEmail];

         IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'IsValidUserByObjectGuid')

           DROP FUNCTION [IsValidUserByObjectGuid];

         IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'IsValidUserByUser')

           DROP FUNCTION [IsValidUserByUser];

         IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'GetUserByObjectGuid')

           DROP FUNCTION [GetUserByObjectGuid];

         IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'GetObjectGuidByUser')

           DROP FUNCTION [GetObjectGuidByUser];

         IF EXISTS (SELECT [NAME]

                    FROM   SYSOBJECTS

                    WHERE  [NAME] = 'TestEmail')

           DROP PROCEDURE [TestEmail]

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'Microsoft.Dynamics.GP.WorkflowGP.WorkflowEngine')

           DROP ASSEMBLY [Microsoft.Dynamics.GP.WorkflowGP.WorkflowEngine];

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'Microsoft.IdentityModel.Clients.ActiveDirectory')

           DROP ASSEMBLY [Microsoft.IdentityModel.Clients.ActiveDirectory];

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'Microsoft.Azure.ActiveDirectory.GraphClient')

           DROP ASSEMBLY [Microsoft.Azure.ActiveDirectory.GraphClient];

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'Newtonsoft.Json')

           DROP ASSEMBLY [Newtonsoft.Json];

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'System.Web')

           DROP ASSEMBLY [System.Web]

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'System.IdentityModel')

           DROP ASSEMBLY [System.IdentityModel]

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'System.Runtime.Serialization')

           DROP ASSEMBLY [System.Runtime.Serialization]

         IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'System.DirectoryServices')

           DROP ASSEMBLY [System.DirectoryServices]

     IF EXISTS (SELECT [NAME]

                    FROM   sys.ASSEMBLIES

                    WHERE  [NAME] = 'Microsoft.Dynamics.GP.DocAttachEngine')

           DROP ASSEMBLY [Microsoft.Dynamics.GP.DocAttachEngine]

  • RE: A .NET Framework error occurred during execution of user-defined routine or aggregate 'GetAssignedUsers'

    Dynamics Web Services Exceptions Console is part of Web Services for Dynamics GP.

    Web Services is related to the Workflow functionality only in that it can be used to allow workflow approvers to approve/reject workflows through the email notifications they receive, other than that, Web Services isn't really used in regular Dynamics GP processes, i.e. "when a user does several things in GP: navigate menu to a different PO the error appears for only certain PO in the finance module from within the Purchase Order Entry screen"

    Web Services is more used with integration functionality such as with eConnect procedures or other processes integrating data into Dynamics GP.

    Is this Purchase Order Entry window/form modified and/or have VBA on it at all?

    Thanks

  • xequence Profile Picture
    xequence 5 on at
    RE: A .NET Framework error occurred during execution of user-defined routine or aggregate 'GetAssignedUsers'

    I see no error in the Event Viewer. I did see that there is another viewer called DynamicsWebServicesExceptionsConsole that should house these errors but it will not open correctly. Thanks in advance!

  • RE: A .NET Framework error occurred during execution of user-defined routine or aggregate 'GetAssignedUsers'

    More times than not, when we see this type of .NET / GetAssignedUsers error, it is in regards to the new Workflow functionality, which may make sense if you have the Purchase Order Approval workflow enabled in the companies where you mention you get this error when navigating to a different PO , etc.

    First, I'd have you try running this script against your DYNAMICS/system database:

            EXEC wfDeployClrAssemblies

    It's normal for this procedure to return a series of warnings in the results window, but that is fine as long as we don't see any error messages or it shows the script failed to run in SQL.

    I will say that usually the rest of the error is "System.IO.FileLoadException: Could not load file or assembly 'System.DirectoryServices', Vers" and not so much 'DirectoryNotFoundException" and the 'Could not find a part of the path....' message.

    As mentioned, I'd look in the Event Viewer logs for additional information as to this error message, if running the above procedure script doesn't help resolve it.

    Thanks

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: A .NET Framework error occurred during execution of user-defined routine or aggregate 'GetAssignedUsers'

    You may be able to find more from the windows event viewer.

    Does this install have custom addins running as I don't recognise the error?

    It looks like some custom code trying to access a directory "C:\Users\devsrv\app[", are you logged in as the user "devserv" in windows?

    Tim

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans