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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

What is "select friend packages"

(2) ShareShare
ReportReport
Posted on by 482

Hi,

When updating model parameters, there is a new tab called Select Friend packages.

What is that?

Based on what does model appear in it?

What happens if i tick one of the packages appearing in the friend packages?

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, I couldn't find much information on 'Select Friend packages' we have in Update model parameters in visual studio. There is this post which has provided some insights into it. It is used for accessing Internal objects and methods of module. In Descriptor file, All reference packages are grouped into ModuleReferences but the friend package has different node 'InternalsVisibleTo'.

    www.linkedin.com/.../

  • DELDYN Profile Picture
    482 on at

    Hi Mohit,

    So before this "friend package" we were able to see internal methods in models we reference but we weren't able to access them??

    Also, i have other 2 questions:

    i'll tell u this case that happened with me.

    There is model A

    Model B references model A and model X in addition to standard models

    Model C references model A and model X in addition to standard models

    Now Before, model X was only referencing standard models.

    I clicked update model parameters, and in the friend packages i saw Model B and Model C in the list

    1. Why did only Model B and C appear?

    2. In general, Model X shouldn't be referencing Model B or C due to circular reference. So how come they appeared in friend packages? And how would i access their internal methods in the first place?

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Let us assumes there is 2 packages Parent and Child. In child package update model parameters parent package is referred and in the friend package you will get custom child packages as friend package. Meaning you will get all the custom parent packages as friend packages.

    If you tick parent package you will be able to access the parent package internal classes or methods from child packages.

    There is no such Microsoft documentation or any blogs available, but this is the functionality.

    Thanks,

    Girish S.

  • DELDYN Profile Picture
    482 on at

    Hi Girish,

    So you mean i will be able to see all custom packages in the system

    as a friend packages regardless of which model i choose to update?

    And what would happen in the case i mentioned? Which is if a i add a friend package that already references my model? Wouldn't that cause circular reference?

    I mean i won't see the model to refer it because of circular reference but why i was able to see it as friend package

  • GirishS Profile Picture
    27,827 Moderator on at

    I think it won't create circular dependency. This is applicable only for accessing the internal methods or classes.

    you can give it a try with this scenario you are saying and test it.

    Thanks,

    Girish S.

  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    Saying that a package is allowed to access internal members isn't the same thing as adding a reference.

    For example, if you say model A allows model B to see its internals, it doesn't mean that A can use objects defined in B.

  • GirishS Profile Picture
    27,827 Moderator on at

    For the example you said. Model X is child package of Model B and also Model C.

    So, it appears in friend package selection.

    Also referencing the model and selecting a friend package is two different things.

    Thanks,

    Girish S.

  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    Saying that a package is allowed to access internal members isn't the same thing as adding a reference.

    For example, if you say model A allows model B to see its internals, it doesn't mean that A can use objects defined in B.

  • DELDYN Profile Picture
    482 on at

    So as a conclusion

    Friends Packages show all custom models in the system

    Friends packages only allow us to view internal variables and internal methods -- without being able to call them by code

    1. Correct?

    2. So if we don't add a friend package, when we open a class thay has internal methods, they will be hidden?

    3. And if don't add a friend package, what if there is a public method and inside it an internal method is called...will i see it?

  • GirishS Profile Picture
    27,827 Moderator on at

    It won't show all custom models. Only the reference models as I said earlier.

    It is not about seeing the internal method in the models.

    Suppose you created internal method say "test" in Model A. There is one more model Model B where you select friend package as Model A. Mostly the method that are declared as internal cannot be used outside of the model. It will be used only inside the model.

    Since you selected Model A as Friend package in Model B you can use or call that internal method "test" created in Model A.

    Thanks,

    Girish S.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans