Access to internal classes from another project

后端 未结 4 1574
野趣味
野趣味 2020-12-19 00:25

I\'m wondering if it\'s possible to access internal class variables from other project in c#. I know that is impossible in regular use, I explain it below.

I have on

4条回答
  •  盖世英雄少女心
    2020-12-19 00:40

    You can use the InternalsVisibleTo attribute and provide the name of a specific assembly that can see the internal types in your assembly.

    That being said.. I think you are bordering on over-designing this. If the Settings class belongs only to Assembly A... don't put it in Assembly B... put it in Assembly A.

提交回复
热议问题