Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DllImportGenerator] Enable on projects without System.Memory and System.Runtime.CompilerServices.Unsafe #61704

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Nov 16, 2021

Don't always add ArrayMarshaller.cs (which uses System.Memory and System.Runtime.CompilerServices.Unsafe). This stops requiring that all the libraries projects that use the source generator at all have those references (even though they may not actually need them for the generated code), such that the generator can be enabled for everything.

If the generated code does end up needing those references, it will just come through as a compilation error.

Added a check - that should be removed once we add APIs like ArrayMarshaller - so that the generator will fire a diagnostic if targeting 7.0+ and missing an API.

@AaronRobinsonMSFT @jkoritzinsky

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants