Skip to content

Solution with application and library #498

Answered by AArnott
Slion asked this question in Q&A
Discussion options

You must be logged in to vote

By default the generated code is emitted as internal. If you do this in the library, the application will have access to it if and only if the library has an InternalsVisibleTo attribute for the app.
As I personally hate InternalsVisibleTo as it leads to lots of design and test issues, I would personally use NativeMethods.txt in each project and have them generate whatever they need independently.

Another option is to use NativeMethods.json to configure the generator to emit public APIs, in which case the code generated in the library would be available to the app without the need for the IVT attribute.

If you generated internal code and use IVT, you can still use two NativeMethods.txt fi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Slion
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants