Announcements
In Dynamics 365 Finance and Supply Chain I'm writing a new rate engine. This involves creating a C# dll.
I would like to debug the execution of the dll.
Are there any instructions on how to do this?
My thoughts are that I'd start the Finance and Operations debugger and attach to iisexpress. From that point on I assumed I somehow have to manually load the symbols for my custom dll and put a breakpoint. I've tried this but so far I haven't managed to hit my breakpoint.
Any tips would be greatly appreciated.
it is basically debugging a C# library but the trick is that the SPS engine, in Tier 1 machines only looks for the dll in the ApplicationSuite binary folder - once I got that figured out, the rest was easy.
Hi Mack,
apologies for not answering earlier. I've been meaning to put up a blog post about this but I kept getting dragged in other matters.
I'll put one up in my blog at some point but you probably can't wait till then, so here is the quick version.
In your ratting engine c# project, - only for the Tier 1 machine, you have to copy the resulting dll into the ApplicationSuite\bin folder. The tutorial will not mention this but if you debug the part where it tries to find the engine, you'll see that it only looks in the ApplicationSuite model. Without this it won't run your engine
Additionally you need to copy the pdb file and the dll (which has your debug symbols into your model's meta data bin folder.
Once you do this it should be able to debug but if you're stuck drop me a line here or on linkedin and I'll try to give you a call (its been a while so memory is a bit fuzzy)
This might help you - in the Post Build Events I added the following steps so that what I said above is done automatically:
xcopy /R /Y "$(TargetDir)$(ProjectName).dll" "K:\AosService\PackagesLocalDirectory\MYRateEngine\bin\$(ProjectName).dll" xcopy /R /Y "$(TargetDir)$(ProjectName).pdb" "K:\AosService\PackagesLocalDirectory\MYRateEngine\bin\$(ProjectName).pdb" xcopy /R /Y "$(TargetDir)$(ProjectName).dll" "K:\AosService\PackagesLocalDirectory\ApplicationSuite\bin\$(ProjectName).dll"
its not about the SPS but about the method you shared for that thread
Sorry, I know nothing about this Small Parcel Shipment - it would be a question to Norbert.
And if you want to discuss development/debugging of C# libraries used outside of the context of SPS, then you're in a wrong thread. In such a case, simply create a new thread and explain your particular problem there.
Hello goshoom
Do you have a step by step documentation or tutorial to do your method please ?
Because i tried but its asked many details that i dont master.
Thanksfully.
so I can confirm that by changing the location of the dll, I can finally debug. Whew
It stands for Small Parcel Shipment (have a typo in the header) but it lets you consume a c# dll to build integrations with providers. You specify the dll in the configuration screen under TMS.
I made some progress - set up a breakpoint in the X++ code which looks for the dll and found out that it was looking for it in a different place then any of the docs specify - seems like to get it to find the dll it has to be copied the ApplicationSuite binaries (the other docs seem to suggest it can stay in your model or in the aoswebroot).
Well, I don't even know what SPS is, therefore I can't comment on why it behaves differently. :-(
That's how I always remember doing it, but for SPS it doesn't seem to load the symbols.
I've also configured the debug based on these instructions to see if it works:
community.dynamics.com/.../debug-microsoft-assemblies
(without doing the pdb stuff as I already have those).
If you have any other suggestion its more than welcome.
What I normally do is adding a C# project to the same solution where I have an X++ project using the C# library. I build the C# project and add a project reference from the X++ project.
Then I put a breakpint to the C# code and run the code (either setting a startup object and running the project, or attaching the debugger to iisexpress. And that's it.
André Arnaud de Cal...
294,120
Super User 2025 Season 1
Martin Dráb
232,871
Most Valuable Professional
nmaenpaa
101,158
Moderator