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)

Automatic build from TFS: How to add Visual studio projects from TFS

(0) ShareShare
ReportReport
Posted on by

Hi to all,

we have implemented our own automatic build based on the codeplex build scripts http://dynamicsaxbuild.codeplex.com/.

We use TFS2010 as version control system.

Basically we implemented the following build steps in order to be able to maintain ID's on our test/production servers.

1) Get the latest sources from Team Foundation Server if specified.
2) Combine the XPOs to a single one.
3) Import a modelstore containing a standard AX installation into the build system.
4) Create the new target model on the build system using the model manifest file.
5) Import the labelfiles into the target model.
6) Import the combined XPO into the target model. This must be done two times in order to resolve dependencies.
7) Export the target model to file system.
8) Import the deployed modelstore of the previous build into the build system. IMPORTANT: this has to done to get rid of ID conflicts.
9) Import the previously created target model into the build system.
10) Compile, generate CIL code, synchronize database.
11) Export the modelstore to file system.

After this step there is a deployment powershell script that will automatically deploy the modelstore, SSRS reports and so on on a target test system.

In the whole build we didn't consider the fact that now new in AX2012 there is the possibility to have Visual Studio projects in the AOT. AX2012 when adding the VS project of the AOT to TFS will export the VS project files and cs files and add them to version control.

As these files are not in XPO format how to import them on our build system?

Is there a way via command line/powershell to add a single VS project to the AOT during the build?

We haven"t used the synchronization procedure of AX (available in the community scripts) in order to be able to manage also deletions of objects. i.e. suppose a developer deletes a given Class.

Thanks for any feedback

*This post is locked for comments

I have the same question (0)
  • Chetana Bhattacharya Profile Picture
    20 on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    Hi Thomas,

     There are two ways to get the VS projects into the AOT during build:

    1. Use the synchronization/force synchronization of AX with version control on the machine from where you are generating the model. This will ensure you have all the latest code base from version control. OR

    2. Export thr VS projects as xpos from an independent machine which is updated with the latest code base and import it into the build machine before you generate/export the model.

     If you use the second approach, you can use the command to import xpos for importing the VS project xpos into AOT.

     Hope this helps.

     Thank you.

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    Hi there!

    I actually have a fix for the VS project import for the build scripts i put on CodePlex, and I know a lot of people are waiting on this so I apologize for not having it up yet.

    If you feel adventurous, the fix i will put in the build scripts (which we're actively using so it's working) is to use an autorun.xml file and call the X++ class to import the VS nodes.

    We have added support in the combineXPOs to "encode" the VS projects, but the import from command line does not work correctly (bug in AX).

  • Community Member Profile Picture
    on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    @Chetana:

    Thanks for feedback.

    1. We don't use your suggestion as we want to achieve to build AX from scratch in order to be sure that deleted objects in TFS will also be deleted on the build environment. Normally the deletion will be applied also using the synchronization procedure but sometimes it could be that the object will not be deleted and remains in the layer/model. We want to avoid such situation.

    2. This is also not an option for us, as we are using TFS and the code under version control for VS projects is not in XPO format. Maybe the "encoding" feature described by Joris could be a solution.

    @Joris:

    Thanks for feedback.

    In the meanwhile we also have implemented a solution in order to import VS projects from command line. It works fine as long there are no dependencies with other assemblies that are in another layer (not customized). In such a case the compilation (that we do during import the single project) will fail.

    For the modifichation you've made on compineXPO I have 2 questions:

    a) Do you use the one provided by informationsource or the other one that exists since AX4?

    b) I did not understand if you use the "encode" feature or not.

    Thanks in advance

    Thomas

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    The combineXPO in the build scripts has always been our own, we don't use the informationsource one or the existing AX4 one. We have our own piece of code that just puts the XPOs together in one XPO.

    I've had several chats with Michael Fruergaard (aka "MFP") from Microsoft about our version of the combinedXPO tool. The tool he released through Microsoft actually optimizes the resulting XPO in that it will order the objects inside the XPO based on dependencies between the objects. Our tool does not do that. The end result is the same, as an import from command line will re-import the objects if they fail due to dependencies. The technicality here is that the "ordered" XPO will import faster since it doesn't have to re-import several times until all dependencies are resolved.

    As for the encoding. If you look at XPOs of Visual Studio projects, you'll notice certain files are not considered text files (although they may be) and they are put in the XPO as an ascii encoded binary file.

    We had one specific Visual Studio project that kept failing to import due to an error about a path that was invalid or something. Even if we took the XPO from the AOT itself and tried to import it, it wouldn't work. Only the call to the tree node for projects (has a static to import VS projects) imported the project without problems. The next problem was that we were importing the XPOs for the X++ code with the nocompileonimport flag. This caused issues with the import of the VS project which uses proxies on some of those X++ classes. Long story short, it was a big mess but we ended up getting it all resolved, mostly thanks to the autorun.xml features, since command line is no longer our friend.

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    As an update, I've released the workflow activities 0.2.0.0 version which includes support for Visual Studio Projects now.

    daxmusings.codecrib.com/.../new-release-of-ax-tfs-build-library.html

  • Suggested answer
    Community Member Profile Picture
    on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    @Joris: we gave already a look to your workflow atcitivies bundle, really nice.

    Our build procedure is based on powershell scripts and as it is working since months we don't think to change it (don't change a running system :-).

    In addition we found a solution in order to import VS projects that have dependencies to an existing project of AX.

    Like your build we use also the class SysTreeNodeVSProject::importProject Method to do the import. We found that when setting the parameter ImportWithReferences to true on instance of VSProjectImport solves the issue.

    Now after weeks of build breaks the build is able to handle this case as well :-)

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    We're not having problems with the workflow activities as they stand, but I'll check into your parameters. We probably don't have one project depending on another, only project depending on X++ code I think.

    Thanks for the tip, I will get that in the next release.

  • Suggested answer
    Community Member Profile Picture
    on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    Finally a new white paper for change management was provided from Microsoft through information source. This document includes also some topics regarding building AX2012 including VS projects.

    Here the link for the document. You need access to information source to download it.

    From the document:

    Overview:

    This document describes development tasks and best practices that are related to application life cycle management in Microsoft Dynamics AX 2012. It focuses on managing metadata changes across Microsoft Dynamics AX installations when multiple developers are working on the same application.

    1. Private AOS topology with TFS

    A private AOS topology is a setup where each developer has his or her own Microsoft Dynamics AX client, AOS instance, model database, and business database. This development topology is recommended by Microsoft. Artifacts are synchronized between developers by using one of the supported version control systems (VCSs) in Microsoft Dynamics AX, and a solution is produced by creating a “build” of the sources in the VCS. Microsoft Dynamics AX supports integration with the following VCSs: Microsoft Visual SourceSafe, Microsoft MorphX VCS, and TFS. This document covers only TFS.

    This topic discusses the tasks for administators and developers in order to build models using a single AOS per developer and build.

    2. Shared AOS topology

    This section describes a shared AOS development topology and contains guidelines to help you achieve the most predictable experience when multiple users are sharing the same AOS instance. This topology is not recommended, because many issues may arise

    In addition some interesting topics around branching,signing models, user permissions and build informations are provided.

  • Suggested answer
    Community Member Profile Picture
    on at
    Re: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    New Build and deploy scripts for Microsoft Dynamics AX 2012 have been provided.

    See the link here http://gallery.technet.microsoft.com/scriptcenter/Build-and-deploy-for-b166c6e4

    From the blog:

    Introduction

    The scripts provide automation for creation and deployment of builds for Microsoft Dynamics AX 2012. The scripts can be used with TFS providing end to end solution for build and deployment. The script performs tasks like sync, creation of TFS label, combining multiple source XPOs to single XPO, validating if build is healthy, etc. These scripts can also work with non-TFS version control where it provides all functionality except the one related to TFS.

    Scenarios

     Following scenarios are covered -

    1. Creating a build – A Microsoft Dynamics AX build is created from specific versions of source files (XPO files, Visual Studio projects, and label files) in the TFS central repository. Source files that share a common label constitute a specific build of a Microsoft Dynamics AX model or application. Output of a build would be model file(s).

     2. Deploying a build – Developer(s) should be able to deploy model file(s) (generated from build process or manually) in Ax installation(s).

  • Community Member Profile Picture
    on at
    RE: AX2012 Automatic build from TFS: How to add Visual studio projects from TFS

    Hi Team,

    I am trying to implement add Visual studio projects from TFS to AX using Team build.

    but i am getting error on Target=ImportToAOT. due to Microsoft.Dynamics.Framework.Design.BuildTasks dll not able to found on build system.

    can anybody has this dll or where i can found the DLL?

    or is there any too/exe support command-line to import vs projects on AOT

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans