Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

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

(0) ShareShare
ReportReport
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
    356 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
    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]

  • Derek Albaugh Profile Picture
    on at
    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
    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!

  • Derek Albaugh Profile Picture
    on at
    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
    5,703 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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans