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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to open exe file in visual studio project.

(0) ShareShare
ReportReport
Posted on by

Hello everyone

I had try to create a C# form with .net business connector and i also added the C# project to AOT. The C# from is in exe format. Can anyone please tell me how to call the C# form out by menu item or button method? or is it AX2012 only allow us to run C# project in dll?

Thank You

Best Regards

Kuan Yi

*This post is locked for comments

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

    You can use an .exe file in the same way as a .dll, i.e. you can use public types defined there in your X++ code. You can even call your Main() method, if you want.

    Or you can run the .exe file as any other application, but then you don't technically need any reference in AOT. You can use WinAPI::shellExecute() or do it through the System.Diagnostics.Process class.

    If it's a WinForm ot WPF form, you could also add it to an AX form through the ManagedHost control (see .NET Controls).

    Also, get rid of Business Connector if possible - your other options are proxy classes, LINQ and WCF (depending on what you're exactly doing).

  • Community Member Profile Picture
    on at

    Hi Martin

    Thank you for your advice, but now i got another questing, i successfully open an exe file with WinAPI::shellExecute(), the file was created by C#. Is it possible for me to pass a parameter from AX to C#? If yes can you please advice me how to make it.

    Thank You

    Best Regards

    Kuan Yi

  • Verified answer
    Martin Dráb Profile Picture
    239,874 Most Valuable Professional on at

    By shellExecute(), you're running the compiled application - it may have been written  in C++, Basic or whatever and you can't access its types. But you can pass command line parameters and handle them in your application (see Main() and Command-Line Arguments).

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 10

#2
Harisgillani Profile Picture

Harisgillani 4

#2
dserp Profile Picture

dserp 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans