In C#, how do you reference types from one in-memory assembly inside another?

后端 未结 2 1007
南笙
南笙 2021-01-06 07:12

The example program below compiles two in-memory assemblies. The first compilation works fine. The second one fails because it needs access to a class from the first assem

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-06 07:52

    Define interfaces in a normal assembly and have classes in each generated assembly implement those interfaces. The generated assemblies will need a reference to the one containing the interfaces, not each other.

提交回复
热议问题