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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Microsoft.Dynamics.AX.ManagedInterop.InvalidLogonInSingleSessionException

(0) ShareShare
ReportReport
Posted on by 1,909

Dears,

I called C# forms in AX as a job and testing connection for one Partition. The code in C# is working fine and connected me to Specific partition. But same action when I called in AX system generated an error InvalidLogonInSingleSessionException. Please let me know how can I solve this error.

pastedimage1583311551121v1.png

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,364 Most Valuable Professional on at

    Unfortunately you forgot to explain your scenario.

    Let me guess:

    You have a Windows Forms application communicating with AX 2012 via Business Connector. Then you took the WinForms form and embedded it AX client through the ManagedHost control. Now your .NET code is trying to create an Business Connector session from inside AX.

    If so, then you shouldn't be doing that at all. You don't need Business Connector, because your code is already running inside AX. You don't have to create another AX client as if you're running code outside AX. Simply expose methods (that can be called from AX) and events (that can trigger methods in AX).

  • Faqruddin Profile Picture
    1,909 on at

    Thanks Martin. Yes I forgot to explain above scenario. As you said the classes and methods running inside the AX  don't require Business connector. But I have simple requirement what If I need to create a customer in two AX partitions than how code would be from C# ? Using Business connector there is possibility to pass a value of company name(partition).

  • Suggested answer
    Martin Dráb Profile Picture
    239,364 Most Valuable Professional on at

    That's a very strange requirement. Doesn't it mean that your setup is wrong and it should be all in the same partition? Because partitions are used if you need a complete isolation and you seem to be working against this only reason for using multiple partitions.

    If you insist of using multiple partitions, consider utilizing runAs() - partition is one of its parameters. Or synchronize the data through a table shared across partitions (SystemTable=Yes, SaveDataPerPartition=No).

    If you want to use Business Connector for some reason, I think you should keep the logic outside AX (e.g. running as a Windows service). But it would be my last choice, only if everything else failed.

    You can see how important is beginning with describing your goals instead of just digging in implementation details of a single, possibly sub-optimal solution. When you tell us what you're actually trying to achieve, we can tell you how.

  • Faqruddin Profile Picture
    1,909 on at

    Ok great. I know this is a strange requirement. I totally completed my project and I dont want to go from scratch with webservices.   I found your verified answer for similar error. Could you please explain me with an example. The verified answer is not clear to understand. Please find Link.

  • Martin Dráb Profile Picture
    239,364 Most Valuable Professional on at

    If you've completed your project, than what are we discussing here? It rather seems to me that your solution doesn't work at all.

    The verified answer of the linked thread is what I suggested in the first reply of this thread. If you do that and stop using Business Connector, then you'll indeed have no problems with Business Connector anymore.

    Note that if I was you, I would first review the whole idea about multiple partitions.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 694

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 646 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 337

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans