June 30, 2026

Friend Packages in D365FO

Hi Folks,

In this post let’s learn about Friend packages in D365FO, which are part of the development model and are configured via Visual Studio. 

A friend package allows one model/package to access internal members (classes/methods) of another package. Normally, only public elements are accessible across models, but this feature extends controlled visibility. They should be used carefully as part of a well-governed architecture strategy.

 This feature allows controlled access between models/packages, specifically enabling access to internal elements without exposing them as public APIs. 

For instance, A core framework model contains internal helper classes for integration. Instead of making them public, you declare integration models as friend packages so they can reuse internal logic safely

Without Friend Package: - Only public elements are accessible 

With Friend Package: - Both public and internal elements are accessible (controlled) 

Why Use Friend Packages?

•       Maintain proper encapsulation

•       Avoid making everything public

•       Enable controlled reuse of logic

•       Improve architectural cleanliness

How to Configure

•       Open Visual Studio

•       Navigate to Extension menu →  Dynamics 365 → Model Management → Update model parameters

•       Select model

•       Proceed to ‘Select friend packages’ step

•       Add required package

•       Finish and rebuild

Benefits

•       Better encapsulation

•       Controlled reuse

•       Cleaner architecture

•       Reduced duplication

Limitations

•       Not a replacement for APIs

•       Can introduce tight coupling if misused

•       Requires governance


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

June 26, 2026

QuickFix: Entity extension DB synch error (Unexpected Metadata Corruption )


I added a new field in standard Vendor v2 entity but after successful build and synch it suddenly started giving DB issue when code deployed to anther dev instance. 

When investigate, found strange issue, 

The extension entity icon got changed, 



Even the property window for this entity showing below error like incorrect meta data.

To fix this, I opened the XML file for this entity extension from my model folder and found some strange code there, still not sure how then ended up there . So hat I did is open other entity extension from metadata and compared both and removed any extra values in file. 

Refresh you model in VS and try to build and synch again



-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta