web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

The assembly that contains the type is not referenced

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I have created a Class Library called LPE_IntegrationWmsLibrary, I signed the DLL

VS.JPG

Firma.JPG

Add the DLL to the following paths

C:\Program Files\Microsoft Dynamics AX\60\Server\instance_name\bin

C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin

Successfully added to GAC 

GAC1.JPG

GAC2.JPG

Add a DLL reference in AOT

0407.AOT.JPG

I have created a service where I have a method that uses the DLL

0602.CODE.jpg

When compiling the service and deploy everything is OK

But calling the service from another application shows the following error

EROR.jpg

I hope you can give me a support.

Thanks and regards

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    236,279 Most Valuable Professional on at
    RE: The assembly that contains the type is not referenced

    You seem to be mixing several different things together. I assume that your pictures are from two different instances of AX and you're trying to call the X++ code referring to your C# class library from another AX via a SOAP web service. Nevertheless the binding log you showed before is from something else, because it was about AX client (ax32) and web services don't use any client.

    If you try to do ten things at once, then debugging becomes very difficult. Don't bother trying to call your code via a web service unless you get it working. If it doesn't work, it can't work through a web service either and you're just making everything much more complicated for you.

    Services run in CIL on AOS, therefore that's what you need to prepare and test. Build the VS project (without errors) and restart AOS. Try to run your code in X++ on server. If it doesn't work, check if the file got deployed to server's VSAssemblies folder and use the binding log to find details. If it works, compile CIL and run your code in CIL as well.

  • Community Member Profile Picture
    on at
    RE: The assembly that contains the type is not referenced

    Hi Martin, thanks for responding

    I have the following configurations

    CODE4.JPG
    CODE2.JPG
    CODE3.JPG
    CODE4.JPG

    CODE5.JPG
    I have a VS project where I call the service

    CODE6.jpg

    CODE7.JPG



  • Martin Dráb Profile Picture
    236,279 Most Valuable Professional on at
    RE: The assembly that contains the type is not referenced

    When you mentioned a service, I thought you're using a web service, therefore something running on server, but clearly it failed in ax32.exe, therefore your code is on client.

    Is your library configured to deploy on client? Did you rebuild it? Did you restart the client?

  • Community Member Profile Picture
    on at
    RE: The assembly that contains the type is not referenced

    Hi Martin,

    Delete the AOT references DLL.

    Add Project VS to AOT and deploy

    The signature to the DLL is maintained, use the tool "Assembly Binding log Viewer"

    5078.VIEW.jpg

    The Log:

    <meta http-equiv="Content-Type" content="charset=unicode-1-1-utf-8"><!-- saved from url=(0015)assemblybinder: --><html><pre>

    *** Assembly Binder Log Entry (3/21/2017 @ 7:06:52 PM) ***

    The operation failed.
    Bind result: hr = 0x80070002. The system cannot find the file specified.

    Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Running under executable C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe
    --- A detailed error log follows.

    === Pre-bind state information ===
    LOG: DisplayName = LPE_IntegracionWmsLibrary
    (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: LPE_IntegracionWmsLibrary | Domain ID: 1
    WRN: A partial bind occurs when only part of the assembly display name is provided.
    WRN: This might result in the binder loading an incorrect assembly.
    WRN: It is recommended to provide a fully specified textual identity for the assembly,
    WRN: that consists of the simple name, version, culture, and public key token.
    WRN: See whitepaper go.microsoft.com/fwlink for more information and common solutions to this issue.
    LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = Ax32.exe
    Calling assembly : Microsoft.Dynamics.AX.ManagedInterop, Version=6.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe.Config
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.EXE.
    LOG: All probing URLs attempted and failed.

    </pre></html><meta http-equiv="Content-Type" content="charset=unicode-1-1-utf-8"><!-- saved from url=(0015)assemblybinder: --><html><pre>
    *** Assembly Binder Log Entry (3/21/2017 @ 7:06:52 PM) ***

    The operation failed.
    Bind result: hr = 0x80070002. The system cannot find the file specified.

    Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Running under executable C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe
    --- A detailed error log follows.

    === Pre-bind state information ===
    LOG: DisplayName = LPE_IntegracionWmsLibrary
    (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: LPE_IntegracionWmsLibrary | Domain ID: 1
    WRN: A partial bind occurs when only part of the assembly display name is provided.
    WRN: This might result in the binder loading an incorrect assembly.
    WRN: It is recommended to provide a fully specified textual identity for the assembly,
    WRN: that consists of the simple name, version, culture, and public key token.
    WRN: See whitepaper go.microsoft.com/fwlink for more information and common solutions to this issue.
    LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = Ax32.exe
    Calling assembly : Microsoft.Dynamics.AX.ManagedInterop, Version=6.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe.Config
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Dynamics AX/60/Client/Bin/EditorComponents/LPE_IntegracionWmsLibrary/LPE_IntegracionWmsLibrary.EXE.
    LOG: All probing URLs attempted and failed.

    </pre></html>

     

    I don't understand what the problem may be if the DLL is already signed

    Regards

  • Martin Dráb Profile Picture
    236,279 Most Valuable Professional on at
    RE: The assembly that contains the type is not referenced

    If you add it to GAC, there is no point copying files to the bin folders. Also, AX 2012 has a feature that allows you to add VS project to AOT and let AX to deploy them automatically, so it's not actually needed to manipulate those files at all.

    If you run your code in a service, it means it runs on AOS. Make sure it's not built only for 32-bit architecture.

    Most likely your class library can't be loaded because it uses another assembly that doesn't exist on your AOS server. If you don't see anything wrong, find more details with Assembly Binding Log Viewer.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans