Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Custom rate engines gi...
Finance forum
Answered

Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

Posted on by 1,423

We have custom transportation rate engines that worked perfectly in AX2012.

We brought them over to D365. We cannot get it to work in D365.

The error I get when I step through the code is:

Message "Could not load file or assembly 'Dynamics.AX.ApplicationSuite.124.netmodule' or one of its dependencies. The system cannot find the file specified." string

Microsoft has provided this link on how to create transportation  rate engines: https://docs.microsoft.com/en-us/dynamics365/unified-operations/supply-chain/transportation/create-new-transportation-management-engine#deploy-the-tms-engine-as-a-package

Nowhere in there does it mention anything special on the build or what version the project needs to be build in. Note that the rate engine project is a mixture between X++ and a C# class library.

When it builds, it generate warnings that I have ignored up till now, but searching for an answer on the error makes me think that I need to look closer at the warning messages.

Here are some:

*****

2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Dynamics.AX.ApplicationFoundation", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Dynamics.AX.ApplicationPlatform", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Dynamics.AX.ApplicationSuite, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

3> No way to resolve conflict between "Microsoft.Data.OData, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "Microsoft.Data.OData, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.

3> No way to resolve conflict between "Microsoft.Data.Edm, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "Microsoft.Data.Edm, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.

3> No way to resolve conflict between "Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.

3> No way to resolve conflict between "System.Spatial, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Spatial, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.

3> No way to resolve conflict between "Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". Choosing "Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" arbitrarily.

3> Consider app.config remapping of assembly "Microsoft.Data.OData, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.6.0.0" [] to Version "5.6.4.0" [C:\Users\User5189d4976dc\Documents\Visual Studio 2015\Projects\TMC_3832_TmsSharedParcelEngineData\TMC.ThirdParty.Parcel\bin\Debug\Microsoft.Data.OData.dll] to solve conflict and get rid of warning.

3> Consider app.config remapping of assembly "Newtonsoft.Json, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" from Version "6.0.0.0" [] to Version "9.0.0.0" [C:\Users\User5189d4976dc\Documents\Visual Studio 2015\Projects\TMC_3832_TmsSharedParcelEngineData\TMC.ThirdParty.Parcel\bin\Debug\Newtonsoft.Json.dll] to solve conflict and get rid of warning.

3> Consider app.config remapping of assembly "Microsoft.Data.Services.Client, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.6.0.0" [] to Version "5.6.4.0" [C:\Users\User5189d4976dc\Documents\Visual Studio 2015\Projects\TMC_3832_TmsSharedParcelEngineData\TMC.ThirdParty.Parcel\bin\Debug\Microsoft.Data.Services.Client.dll] to solve conflict and get rid of warning.

3> Consider app.config remapping of assembly "System.Spatial, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.6.0.0" [] to Version "5.6.4.0" [C:\Users\User5189d4976dc\Documents\Visual Studio 2015\Projects\TMC_3832_TmsSharedParcelEngineData\TMC.ThirdParty.Parcel\bin\Debug\System.Spatial.dll] to solve conflict and get rid of warning.

3> Consider app.config remapping of assembly "Microsoft.Data.Edm, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.6.0.0" [] to Version "5.6.4.0" [C:\Users\User5189d4976dc\Documents\Visual Studio 2015\Projects\TMC_3832_TmsSharedParcelEngineData\TMC.ThirdParty.Parcel\bin\Debug\Microsoft.Data.Edm.dll] to solve conflict and get rid of warning.

3>C:\Program Files (x86)\MSBuild\Microsoft\Dynamics\AX\Microsoft.Dynamics.Framework.Tools.BuildTasks.targets(75,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Microsoft.Data.OData" culture="neutral" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /><bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Microsoft.Data.Services.Client" culture="neutral" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Spatial" culture="neutral" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Microsoft.Data.Edm" culture="neutral" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /></dependentAssembly></assemblyBinding>

*****

What I read about these errors, is that it means that AX is on one version and that Visual Studio compile sit against another. It looks to me that AX is X86. By default the projects are compiled as Debug/Any CPU. It looks like I need to change it to Debug/X86. I did that but the build gave even more warnings. So I changed it to Debug/X64, but still the warning messages.   

 

So I don't know if I am on the right track to fix my run time exception error.

Can anybody shed some light for me on this error ("Could not load file or assembly 'Dynamics.AX.ApplicationSuite.124.netmodule' or one of its dependencies. The system cannot find the file specified." ) please with a possible solution on how to fix it?

  • CU23051409-0 Profile Picture
    CU23051409-0 2 on at
    Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO
    Hello,
    Can you share the code for integrating in DLL.
  • Retha Profile Picture
    Retha 1,423 on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    It worked great after installing the KB which was a binary update.

    When you test in your Dev environment you have to copy it over to ApplicationSuite/bin.

    But in production it runs against your custom engine package. So if you say it only works in your environment when copied into applicationsuite/bin,

    is it in your Dev environment or production?

    If production, are you using TFS as your source control?  I am and it happened once that it was searching for it in applicationSuite/bin in UAT during user testing and then  I discovered that I forgot to add the reference to source control. You should add the DLL as well as the reference to source control under your package.

    When you created your project, after completing the C# class, implemented the engine and built your solution , you added it as a reference to the  project. If you look at the properties of this reference, its Item Path points to your custom engine package. It is this reference that is added in the AOT under the References node. And it is this reference node that you need to add to source control.

    So in your source control explorer for Dynamics 365 > Trunk > Dev, you have a sub-directory for your custom engine package.  Under that package you have a bin, Descriptor and your package directories. The bin-directory will contain your DLL and under the folder for your package, you will have all the available AX folders of which one of them is axReference. You add your engine's reference here in source control. Then when you merge and queue a build to create a deployable package and installed it on UAT and eventually production, the rate engine will be found under your package.

  • AXDeveloperJunior Profile Picture
    AXDeveloperJunior 100 on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    Did it finally work? Is there no problem in new updates? In my environment only is possible if I add dll to path ApplicationSuite/bin, but I would like to move it to my own package.

  • Retha Profile Picture
    Retha 1,423 on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    The KB was just released.

    KB 4463215: Error Rate Shopping for 3rd party carrier: TMSEngineSetupException: Assembly 'SPSThirdPartyTMSEngines.dll' found and loaded, but engine class 'SPSThirdPartyTMSEngines.BLL.Rating.UPSWSRateEngine' was not found

  • Verified answer
    Retha Profile Picture
    Retha 1,423 on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    Had to log a support issue in the end and heard back from Microsoft today that a hotfix is on its way for this problem:

    fix.lcs.dynamics.com/.../Details;qc=9ebe4f7cc0b21d1820f01b5a604eff6cfd97cff49d4b3b778495ea5b6fe30922

  • Retha Profile Picture
    Retha 1,423 on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    Hi Malik, 

    I'm finally starting to look at our engines again.  I have tried to create a rating engine exactly as the the rating engine in Mircosoft's blog regarding creating a new TMS engine. Same as you, it errors out that it can find the DLL but not the class.

    Our custom has an engine that contains all the code that is the same for all the other engines. Its class library inherits from BaseRateEngine like in the block. Lets call this one's class library: BaseEngine.

    Then the other engines' class libraries inherits from  BaseEngine as well as TMSFwkIRateEngine:

    public class NewWSRateEngine : BaseEngine, TMSFwkIRateEngine

    {

    }

    I haven't tried it yet but I wonder if TMSFwkIRateEngine is the missing piece you mentioned. This may also explain why you gets the error on TmsTransactionFacade. Also what I have found is that I had the using directives outside of the namespace. C# adds it automatically first and then the namespace after it when creating a class library. I see in the blog they had the using directives inside the namespace. This was one of my problems too. I had it first and then the namespace. I have moved the using directives inside the namespace and now I do not get the error that it can find the dll but not the class and the 124.netmodule error.

  • D365 Developer Profile Picture
    D365 Developer 215 on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    Hi Malik, 

    I face the same errors while working on generic weight transportation engine. Did you find any solution?

    Regards

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    Another interesting observation is that when I build the C# project just like mentioned in the Microsoft blog for creating a new TMS engine, I don't get any error's.

    However, when I did a Full build(Selecting all packages) on my dev environment, I get these following errors,

    Severity Code Description Project File Line Suppression State

    Error CS0534 'SampleRatingEngine' does not implement inherited abstract member 'BaseRateEngine.rate(TmsTransactionFacade, XElement, string)' TestTMSEngines C:\Users\Useracb4806e2fd\Documents\Visual Studio 2015\Projects\TMSTestEngine\TestTMSEngines\SampleRatingEngine.cs 9 Active

    Error CS0115 'SampleRatingEngine.rate(TmsTransactionFacade, XElement, string)': no suitable method found to override TestTMSEngines C:\Users\Useracb4806e2fd\Documents\Visual Studio 2015\Projects\TMSTestEngine\TestTMSEngines\SampleRatingEngine.cs 11 Active

    Error CS0246 The type or namespace name 'TmsTransactionFacade' could not be found (are you missing a using directive or an assembly reference?) TestTMSEngines C:\Users\Useracb4806e2fd\Documents\Visual Studio 2015\Projects\TMSTestEngine\TestTMSEngines\SampleRatingEngine.cs 11 Active

    Any help would be much appreciated.

    Thanks,

    Malik

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    I am also stuck at the same step. Can't seem to make it work.

    My exeption,

    Microsoft.Dynamics.Ax.Tms.Base.Utility.TMSException: TMSException: Error RateShopBroker ---> Microsoft.Dynamics.Ax.Tms.Base.Utility.TMSException: TMSEngineSetupException: Assembly 'TestTMSEngines.dll' found and loaded, but engine class 'TestTMSEngines.SampleRatingEngine' was not found. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Dynamics.AX.ApplicationSuite.124.netmodule' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

    I followed all the steps from Mircosoft's blog regarding creating a new TMS engine. It feels like something is missing there.

    I also copied the DLL that is created to <packageLocaldirectory>\ApplicationSuite\Bin. But, it didn't fix the problem for me.

    My version is 7.3 with PU12.

    Any help would be much appreciated in resolving this issue.

    Thanks,

    Malik

  • Retha Profile Picture
    Retha 1,423 on at
    RE: Custom rate engines give error 'Dynamics.AX.ApplicationSuite.124.netmodule' on D365FO

    I got past the engine class not found. Did you make sure your class name in your visual studio project has the same name as the Engine class in your rate engine setup? Remember C# is case sensitive, so you shouldn't just look that the spelling is correct, you should also make sure your capital letters and small letters are the same.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans