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 :
Microsoft Dynamics AX (Archived)

.NET Version - Asyn Call - Task.Run() vs Task.Factory.StartNew()

(0) ShareShare
ReportReport
Posted on by

Hello!

I am trying to implement an self written .NET library. During the development I used .NET Framework 4.5 (on the PC). Right now I am trying to integrate my working library into AX 2012 (CU12). I thought .NET 4.5 is supported by the AX2012 CU12?! Am I wrong? Because right now my library dies when this line of code will be called by my lib:

var Result = await Task.Run(() => DoWorkFindAddressesOnPtvXServer(tempAddresses, taskReady));

 

Do I have to change it to TaskFactory....? How can I figure out which .Net version will be supported by the client? 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Check the system requirements guide here on Page 8, various versions are using different .Net framework.

    https://www.microsoft.com/en-us/download/confirmation.aspx?id=11094

    4.5 is required by AX 2012 R3 and above, and supported below.

  • Community Member Profile Picture
    on at

    But there is no "upgrade" to 4.5 during the AX 2012 R3 CU12 update!?

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Your issue could be related to which target have you compiled your library for. If it is initiated in client, the AX client is 32-bit only. If it is running server-side, then you need 64-bit.

    Also for client-side try selecting Target Framework as Client Profile in the solution's application properties.

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    await can be used only in asynchronous methods. Does it mean that you're trying to call an asynchronous method through a synchronous call from X++ (which doesn't know anything about async)? If so, it should look suspicious to you.

    By the way, why does your title says "Task.Run() vs Task.Factory.StartNew()". I don't see anything related in the body of your question.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans