Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Build Automation Custom Model Reference Error

(0) ShareShare
ReportReport
Posted on by 1,214

Hi,

This is continuation from my effort here https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/401765/build-automation-add-nuget-package-to-azure-artifacts-feed where I'm trying to configure build automation.

After successfully adding nuget packages to azure devops feed, I imported the sample pipeline from https://github.com/microsoft/Dynamics365-Xpp-Samples-Tools/tree/master/CI-CD/Pipeline-Samples to my project.

Now I'm running the build for the first time. I have custom models with below naming conventions:

  • TDD9
  • TDD10
  • TDD11
  • TDD12

These models have dependencies like following:

  • TDD10 refers to TDD9.
  • TDD11 refers to TDD9 & TDD10.
  • TDD12 refers to TDD9, TDD10 & TDD11.

In DevOps repos, naturally they are sorted by name alphabetically like this:

  • TDD10
  • TDD11
  • TDD12
  • TDD9

So when running the pipeline, looks like it builds TDD10 first and since TDD10 have reference to TDD9 & TDD9 haven't been built yet, the build throws error

"No assembly matching referenced module 'TDD9' is found".

How can we handle this situation? Can we sort which models to build first?

There has to be a way where it automatically detects all model dependencies and run the build accordingly I assume?

Thank you.

  • HAIRUL HAZRI Profile Picture
    1,214 on at
    RE: Build Automation Custom Model Reference Error

    Hi Joris,

    So in DEV environment, I created a new solution and added all existing projects inside.

    Then I check-in the solution.

    Since I checked-in all those solutions for each model, in Visual Studio build task in pipeline, I made sure to build only the newly created solution that contains all projects & models.

    This helped me to get past the build error.

    Thank you.

  • Verified answer
    Joris dG Profile Picture
    17,775 on at
    RE: Build Automation Custom Model Reference Error

    You should create a solution that has a project for each of your modules. If you're on PU36 or above that should result in the compile ordering automatically. If you have each module in its own solution, Visual Studio msbuild has no way of figuring out orders. It's the same concept you would see with C#.

    That said - having a separate model for each requirement is absolutely a bad idea. You should minimize the amount of models/modules you have, otherwise it will become a code maintenance and customization discovery nightmare.

  • HAIRUL HAZRI Profile Picture
    1,214 on at
    RE: Build Automation Custom Model Reference Error

    We don't have any build VM. All this while we only create package from DEV environment. We didn't even use source control.

    Because of the All-in-one deployable package enforcement, this is our first time working with source control and azure pipeline.

    Anyway, where should I look to resolve this?

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Build Automation Custom Model Reference Error

    No I meant the traditional pipeline with a build server. It's created automatically if you deploy a build VM from LCS.

  • HAIRUL HAZRI Profile Picture
    1,214 on at
    RE: Build Automation Custom Model Reference Error

    Hi Nikolaos,

    do you mean this part?

    basic-build-pipeline.PNG

    Aren't they the same build task?

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Build Automation Custom Model Reference Error

    The alphabetical order of the model/package names should not impact the order in which they are built by the build process.

    Have you managed to build your codebase succesfully with a normal build server (using a build pipeline)?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans