-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 should error if attribute is applied to an extern #62700
Comments
That seems different, it concerns the emitted code. This is about an error while enumerating the attributes |
We have an analyzer that should be warning when the attribute is used on a method without Lines 82 to 83 in 55fecfb
We'll have to check why that didn't seem to do its job in this case. That analyzer only looks for |
Will this analyzer always run when the generator is used? A rule like this should always fire. |
Yeah, it should always run when the generator is used. It lives in the same assembly as the generator, so the analyzer reference to that assembly should pull in both the generator and analyzer. |
Ah, it is possible to use the generator, but disable all analyzers by setting |
Perhaps some of these basic cases can be error cases in the generator. |
Bug #62616 was caused by applying
[GeneratedDllImport]
to anextern
rather thanpartial
method. The compilation succeeded, but the analyzer ignored it, and there was a failure at runtime.(no RVA).
from this message:IDS_CLASSLOAD_MISSINGMETHODRVA "Could not load type '%1' from assembly '%2' because the method '%3' has no implementation (no RVA)."
because it's what you see in this case, and it seems a rather technical distraction - not sure how relative virtual address is helpful here, the essential fact is that the implementation is missing.
The text was updated successfully, but these errors were encountered: