Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

gp could not load file or assembly created by dag.exe

(0) ShareShare
ReportReport
Posted on by

I create a dll from a Dexterity CNK file. I have to sign it and it works fine in GP addin in my window 7 x64 PC.

dag.exe 7577 "C:\Program Files (x86)\Microsoft Dynamics\GP2013\Dynamics.set" /M /S:xx.snk

It cannot load in a windows 2008 x64 WM with same GP 2013.  Details as below:

System.IO.FileLoadException was unhandled

  Message=Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Dynamics\GP2013\Addins\Application.xx.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

  Source=mscorlib

  FileName=file:///C:\Program Files (x86)\Microsoft Dynamics\GP2013\Addins\Application.xx.dll

  FusionLog=""

  StackTrace:

       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)

       at System.Reflection.Assembly.LoadFrom(String assemblyFile)

       at Microsoft.Dexterity.Bridge.AddinManager.LoadAddinsFromFolder(String folderName)

       at Microsoft.Dexterity.Bridge.AddinManager.InitializeAllAddIns()

       at InitAddIns()

       at _WinMainCRTStartup()

  InnerException: System.NotSupportedException

       Message=An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See go.microsoft.com/fwlink for more information.

       InnerException:

 

*This post is locked for comments

  • Greg Kowieski Profile Picture
    90 on at
    RE: gp could not load file or assembly created by dag.exe

    For me, the answer was to copy my DLL's into the Visual Studio Tools directory where Dag exists.  Or copy the Dag.exe into the GP directory where your dll's should exist.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: gp could not load file or assembly created by dag.exe

    Does your integration have any other references added to it?  If so, those DLL's will also need to be added to your Dynamics GP installation folder.  For instance, if I reference the fixed assets module in my integration I would have to DAG and then include the subsequent DLL for FA along with the DLL for my integration.

    Regards,

    Aaron

  • Community Member Profile Picture
    on at
    RE: gp could not load file or assembly created by dag.exe

    I figured it out.

    Never copy dll using web tools like drop box. After removed the web copy flag, the error is gone.

    stackoverflow.com/.../net-local-assembly-load-failed-with-cas-policy

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 > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans