-
-
Notifications
You must be signed in to change notification settings - Fork 534
IFileEntryOwner: Prevent ConstructorContainsNullParameterNames when AOT Compiled #6032
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
IFileEntryOwner: Prevent ConstructorContainsNullParameterNames when AOT Compiled #6032
Conversation
To summarize how the bug works (for me and for future reference): It starts here in js:
which calls a dotnet method, implemented here:
This fails to be marked as "unable to be deserialized" due to AOT trimming. Is that correct? The bug fix works, yes. We can merge it. But I don't like the solution:
I suggest creating Similar issues exist on the js side, where some "hacks" are used to avoid serialization:
So we might want to solve it on both sides. Not part of this PR—we can move this to another ticket. @mtbayley Can you add a simple comment explaining why the attribute is there? btw thanks for this and for the referenced issue, I had no idea such issues might happen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the comment
@tesar-tech Yes, you understand the issue correctly. I have run into a similar issue with my AuthenticationStateProvider in my work.
If you have a better solution, I'm up for testing that as well. I agree, the error only occurs during runtime for a released AOT compiled app. It would be hard to catch during development or testing. |
@stsrki what's the strategy?
|
I think we don't even need it. Why can't we remove Or, change
|
That will just eliminate the purpose of the interface and duplicate the code. The shared functionality is there, because it's the same for both of the classes. And it wont solve the "might happen for other types that should not be in dto" issue. |
The thing is, we shouldn't have introduced a new API in the 1.7 release. We broke our own rules, basically. At the time, I had wrongly assumed it was not a big change, so it wouldn't hurt. So I would rather to duplicate code then introducing JSON attribute to the interface. We can optimize it in 1.8. |
The
sounds like you don't really care. If that's the case, I have no objections against the latest changes. |
Description
Closes #6029
How Has This Been Tested?
Tested with Demo App
Types of changes
Checklist:
master
for dev,rel-1.x
for maintenance).