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)

AX 2012 Using different Service Reference app.config variations after TFS Synchronize

(1) ShareShare
ReportReport
Posted on by

Hello all,

I'm looking for ideas on how to handle the following situation in a more automated fashion.  

We have a production and dev/qa shipping service that is accessed by AX using a visual studio project.  The visual studio project currently has an app.config that points to production (so that when deployments take place, we won't forget to change this setting).  So the problem is that when we sync source to dev environments from TFS, we get the production settings.  We have to remember to replace the app.config file with a version that points to a dev/qa instance of the shipping service.  Another issue is that each time the aos is restarted, the app.config file gets rebuilt and therefore points to production once again.  

You can reverse the roles of the previous scenario and the problem still exists.

I've toyed with the idea of having all service reference situations like this placed in a model and deployed to the usr layer via deployment scripts.  I don't have this all thought out yet.

What are some things that other organizations have done to manage this issue?

*This post is locked for comments

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

    I would create a parameter in AX database for instance-depend settings (e.g. service address) and set the value from this parameter rather then from the configuration file. Therefore app.config would be the same for Dev and Prod, but they obviously use different databases.

  • Community Member Profile Picture
    on at

    Well I finally got around to performing these actions and all was going well according to Martin's recommendations (Thanks so much).  But now I am trying to keep the value in the application ID node of the headers section.  See xml for reference

    <client>

               <endpoint address="qashipping.tc.inet/.../Shipping.svc&quot;

                   binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IShipping"

                   contract="ShipNow.IShipping" name="WSHttpBinding_IShipping">

                 <headers>

                   <ApplicationId xmlns="mydomain.com/.../ss&quot;>MyAppId</ApplicationId>

                 </headers>

               </endpoint>

           </client>

    It seems the value in the application id (MyAppId) is retained when running this line of code.

    endPoint = service.get_Endpoint();

    The service I am calling throws an error saying to send a valid ApplicationId.  I have validated several times that the Application ID is in the config file to begin with.   I have been doing some guess work and research to determine what needs to be done to retain the current application ID or to use contents of a table field.  I am hitting a wall.  I will continue to research but any assistance would be great.  

    Thanks,

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