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)

Building Dynamics AX7 project using MSBuild from command line

(0) ShareShare
ReportReport
Posted on by

I am attempting to build my AX7 Solution using MSBuild.  I am using Jenkins to build it.

I am using the MSBuild.exe from "C:\Windows\Microsoft.NET\Framework\v4.0.30319".

I am using the following command line arguments: /t:Build /p:Configuration="Release" /v:n

I am getting the following errors (In a Solution that builds normally in Visual Studio).  Any ideas?  Are there any command line arguments or environment variables I need to set?  Am I using the wrong MSBuild?  Should I be using the Framework64 version?

13:38:49   Building solution configuration "Release|Any CPU".
13:38:49 Project "C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\PrecisionForms.AX7.sln" (1) is building "C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\ApplicationSuite.BT_DPA\ApplicationSuite.BT_DPA.rnrproj.metaproj" (2) on node 1 (default targets).
13:38:49 Project "C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\ApplicationSuite.BT_DPA\ApplicationSuite.BT_DPA.rnrproj.metaproj" (2) is building "C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\ApplicationFoundation.BT_DPA\ApplicationFoundation.BT_DPA.rnrproj" (3) on node 1 (default targets).
13:38:49 Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=291333.
13:38:49 PrepareForBuild:
13:38:49   Creating directory "Bin\".
13:38:49   Creating directory "obj\Debug\".
13:38:49 C:\Program Files (x86)\MSBuild\Microsoft\Dynamics\AX\Microsoft.Dynamics.Framework.Tools.BuildTasks.targets(55,5): error MSB4062: The "CopyReferencesTask" task could not be loaded from the assembly Microsoft.Dynamics.Framework.Tools.BuildTasks, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. Could not load file or assembly 'Microsoft.Dynamics.Framework.Tools.BuildTasks, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\ApplicationFoundation.BT_DPA\ApplicationFoundation.BT_DPA.rnrproj] 13:38:49 Done Building Project "C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\ApplicationFoundation.BT_DPA\ApplicationFoundation.BT_DPA.rnrproj" (default targets) -- FAILED.
13:38:49 Done Building Project "C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\ApplicationSuite.BT_DPA\ApplicationSuite.BT_DPA.rnrproj.metaproj" (default targets) -- FAILED.
13:38:49 Done Building Project "C:\Program Files (x86)\Jenkins\workspace\AX Connector for New Dynamics AX\Projects\UpgradedSolution\PrecisionForms.AX7.sln" (Build target(s)) -- FAILED.
13:38:49
13:38:49 Build FAILED.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    236,320 Most Valuable Professional on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    Are you sure that you want to let your build server to build just an individual project, instead of the whole package?

    If I was you, I would follow the same process that Microsoft use in their VSTS build template.

  • Community Member Profile Picture
    on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    I'm building the Solution, which builds the projects, not the projects themselves.  I just figured if you can build the solution using Visual Studio, you should be able to build it by just using MSBuild and pass it  the solution filename.

    You speak of "the same process that Microsoft use in their VSTS build template".    What process is that?  Is it a particular proj file they use? Can you give me more detail?

  • Martin Dráb Profile Picture
    236,320 Most Valuable Professional on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    My point is that you're trying to build just a few objects and not the whole assembly (package). I wonder why would you do that. The argument that developers don't do full model build after every change isn't valid - on contrary, because developers don't do it, automated builds must do it for them. It's their raison d'etre.

    You may be trying to create your own build process because you don't know that Microsoft already did that. If you associate your LCS project with VSTS and deploy a build environment from LCS, it adds a VSTS build template for automated build. Then you can simple queue a new build from VSTS and it will run, without any work on your side.

  • Community Member Profile Picture
    on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    We originally used VSTS while we were upgrading our solution (which was previously made for older versions of AX), but for reasons too numerous to mention, we will eventually be moving to our own GIT repository, and we will need a build environment that is not run by VSTS.

    So, long and short, is it possible to build our product using the command line?  And if so, how?

  • Martin Dráb Profile Picture
    236,320 Most Valuable Professional on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    Is it possible? Of course it is. I'm trying to explain it's already done by Microsoft. There wouldn't be the automated build from Microsoft if it wasn't possible.

    I didn't say you should use VSTS (although I would recommend it). I mentioned it because you can simply copy the build step from there, instead of reinventing the wheel.

  • Community Member Profile Picture
    on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    Your answer, while technically correct, is not very helpful.  Can you point me to any resources that would explain what I need to do to get this done?   I'm aware that using VSTS is recommended by Microsoft, but, as I said, we have several reasons we are not going in that direction.

    If you can't point me somewhere to figure this out, Is there anyone from Microsoft monitoring these forums that could provide some guidance?

  • Martin Dráb Profile Picture
    236,320 Most Valuable Professional on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    I told you that the solution is already done, where you can find it, that you can copy the scripts, parameters etc., so you can use them in Jenkins. What else do you need from me?

    Is it documented? No, but you can see source code and an example (in the standard build template).

    Some Microsoft employees sometimes contribute to this forum, but I think they would tell you the same. Normally you could contact support, but they're not going to help you with your custom development of builds on unsupported platforms.

    Seriously, the best thing you can do it is to deploy a build box (as explained above), review the build template, copy the project definition and scripts and use them in your Jenkins build. You're free to ignore this advice, but good luck then...

  • Community Member Profile Picture
    on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    By the way, I _am_ building the models.  That's what I'm trying to do.  By "where I can find it", you told me to deploy a build server from LCS and "go copy the scripts".   I can spend a day getting that to deploy and then hunt around and try to figure out where on the box those scripts are, what tools they're using, what the command line arguments mean on the tool they're using, how to get the same tool on my box, etc.

    I've just started doing X++ development, then add on AX7 and all this stuff (regarding AX7 specifically) is so badly documented (or not documented at all).  I was just hoping for an article or something on how it's done somewhere.  I haven't found anything myself.

    So, while I appreciate your effort in replying, I don't need anything else from you, thanks.  

  • Martin Dráb Profile Picture
    236,320 Most Valuable Professional on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    You would "hunt around and try to figure out where on the box those scripts are" only if you missed the fact that there is a step in the build template doing the build, so you can all see it there. It's all ready for you, if you want it...

    I might write an article about the standard builds in AX, but don't expect Microsoft documenting how to setup it on Jenkins, because they don't support it.

  • Community Member Profile Picture
    on at
    RE: Building Dynamics AX7 project using MSBuild from command line

    I was just looking to see if there was any documentation on a command line tool for building models/packages.  Jenkins really doesn't factor into it.  It's clear that there isn't.  Of course, doing that isn't supported, because I guess Microsoft wants to get that revenue from deployed Azure servers.

    My project is already in VSTS and LCS - looking around there, I can't find anything about how to deploy a build server.  There are choices for "demo" and "devtest" I've already deployed a "devtest" environment, both locally and on Azure.    So far, I can't even get to the step where you deploy the build environment, much less getting to where this vaunted build template is on the machine once I do it.

    I'm sure this is all very simple for you, but for me, it's not working out that way.

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