Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Error sending email if DYNSA is not sysadmin

Posted on by 190

Workflow is installed on the same host as  SQL, when configuring the Workflow Setup with SMTP and email address, the test email failed  with the message to enable CLR which I have with:

EXEC sp_configure 'clr enabled', 1; RECONFIGURE WITH OVERRIDE

The next message from  the email test was an error loading the assembly id 65565.

An error occurred in the Microsoft .NET Framework while trying to load assembly id 65565. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error: System.IO.FileLoadException: Could not load file or assembly 'microsoft.dynamics.gp.workflowgp.workflowengine, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A) System.IO.FileLoadException: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString)

I enabled Trustworthy on the DYNAMICS and company databases with:

ALTER DATABASE TWO SET trustworthy ON

After making DYNSA a member of the sysadmin SQL role the test email would send successfully. 

I do not believe I should have to enable the  trustworthy option on the GP databases and have  DYNSA as sysadmin for this to work. 

Some background:  These database were initially built and some initial setup done on another database server before being transferred to the final SQL server.  Web Services was initially configured on another virtual server before being installed on the same host as SQL to consolidate servers.

I do not believe DYNSA needs to be sysadmin, how can I remove this work around?

Rich

*This post is locked for comments

  • Suggested answer
    Kumar_Sat Profile Picture
    Kumar_Sat 1,146 on at
    RE: Error sending email if DYNSA is not sysadmin

    Hi Lance,

    You have saved my life. I had been struggling with it for a while and when I saw your post and ran this script and it worked like a charm. Thanks for sharing it.

  • john doel Profile Picture
    john doel 335 on at
    RE: Error sending email if DYNSA is not sysadmin

    Not sure if you're still running into this, but if you run EXEC DYNAMICS.dbo.wfDeployClrAssemblies on the destination server after placing the databases, this will avoid the issue. This is typically run in GP Utilities when going through an upgrade or new install and handles configuring SQL for properly accessing the external CLR assemblies that work flow relies upon. This will avoid having to set the entire database to TRUSTWORTHY ON and making DYNSA sysadmin.

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

Featured topics

Product updates

Dynamics 365 release plans