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

can we embed a certificate file in ax project just like resources in class library c# project

(0) ShareShare
ReportReport
Posted on by 230

Hi All,

I have a C# dll which consumes a web services using a certificate, in 2012 we provided the certificate in a local path, and passed the path to C# dll, now I ma trying to attach the certificate within the c# dll and consume it.

public ExchangeRateWSClient(string serviceUrl)
        {
            try
            {
                byte[] cert = Properties.Resources.Bloomberg;
                currencyPairList = new List<string>();

                clientCert = new X509Certificate2(cert, "test");
                serviceEndpointAddress = serviceUrl;
                pollInterval = 5000;
            }
            catch (Exception e)
            {
                throw new Exception(string.Format(e.Message));
            }

        }

but the point is the certificate expires after every 3 yrs in that case we have to build the dll again with the new certificate.

I want to embed certificate in ax ax project and then pass it to .net dll.


 

*This post is locked for comments

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

    Yes, you can use any kind of file as a resource in AOT. And yes, you must deploy a new version if you change it.

    For reference, this is somewhat related to our previous discussion in Local Folder Path in ax 365.

  • Krishnendu Profile Picture
    230 on at

    Yes it is related to that discussion,

    if I add the resource it will be in the that's model axresource folder...

    J:\AosService\PackagesLocalDirectory\Currency\Test\AxResource\ResourceContent\Data\Bloomberg.pfx

    I want to pass the resource name ....How do we access that resource file in x++ ?  

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

    Use the SysResource class for working with resources.

  • Community Member Profile Picture
    on at

    We've overcome this exact issue, also with Bloomberg, by storing the certificate via Document Handling. I can share the code if you need it.

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

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans