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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Dll missing after moving to test system to self-service environment

(0) ShareShare
ReportReport
Posted on by 81

Greetings All,

We have a custom c++ DLL that we have integrated into D365 SCM. The Dll was working until we switched from a "Microsoft Managed" environment to the "Self Service" environment.

The DLL is in  the deployment package and is located in the Model\Bin folder & I have redeployed since the environment was set up.

Has this location moved for self service environments? I have tested in our dev environments and all is working.

I have submitted a ticket to MS, but thought I would reach out here as well in case there was a quick fix.

Error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.DllNotFoundException: Unable to load DLL 'rmycustomfunction.dll': The specified module could not be found.

Regards, Mark

I have the same question (0)
  • WillWU Profile Picture
    22,363 on at

    Hi Mark,

    The C++ dll you're refering, it's compiled in 32bit or 64?

    Have you downloaded the correct version of C++ Redistributable Packages?

    support.microsoft.com/.../the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0

  • mblevins Profile Picture
    81 on at

    It is compiled for 64bit. I have not added any other Dlls. I assume based on what I have seen from others it's due to the self service environments being hosted on server 2016 core.

    Do I need to add the redistributable dlls as well to the project and deploy to the tier 2 environment?

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    Can you check axReference folder

    File location:-

    K:\AosService\PackagesLocalDirectory\<Model Name>\<Model Name>\AxReference

    d365byjp.blogspot.com/.../adding-c-project-reference-to-d365.html

    axcalated.blogspot.com/.../d365fo-adding-custom-dll-to-project.html

  • mblevins Profile Picture
    81 on at

    Thank you for the links, We do have the wrapper class referenced. It works in dev and was working prior to the switch to the "self service" environment.

    I believe the issue is the .net has to import a C++ dll.

    This requires use to the the DLLImport function in the .net code to call the C++ dll.

    Ex:

    internal class MyCustomDLL{
           [DllImport("MyCPlusPlus.dll", EntryPoint = "MyFunction")]
           internal static extern unsafe int MyFunction(string parm1) }

    It fails when trying to invoke the function.

    RetValue = MyCustomDLL.MyFunction("hello world");

    Microsoft is currently reviewing our environment and hopefully will find a solution soon.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 303 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 122 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans