web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    236,160 Most Valuable Professional on at
    RE: How to open exe file in visual studio project.

    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).

  • Community Member Profile Picture
    on at
    RE: How to open exe file in visual studio project.

    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
    236,160 Most Valuable Professional on at
    RE: How to open exe file in visual studio project.

    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).

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Rahul Shah Profile Picture

Rahul Shah 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans