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

Remove unsupported fields from GeneratedDllImport #61181

Closed
Tracked by #60595
elinor-fung opened this issue Nov 3, 2021 · 6 comments
Closed
Tracked by #60595

Remove unsupported fields from GeneratedDllImport #61181

elinor-fung opened this issue Nov 3, 2021 · 6 comments

Comments

@elinor-fung
Copy link
Member

elinor-fung commented Nov 3, 2021

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 3, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@elinor-fung elinor-fung added area-System.Runtime.InteropServices and removed untriaged New issue has not been triaged by the area owner labels Nov 3, 2021
@elinor-fung elinor-fung added this to the 7.0.0 milestone Nov 3, 2021
@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Nov 3, 2021
@jkotas
Copy link
Member

jkotas commented Nov 4, 2021

Do we have a plan on what to do about CharSet, CharSet.Ansi in particular?

CharSet.Ansi makes no sense on non-Windows. I see that the source generator requires you to explicitly specify CharSet when marshaling strings. At minimum, would it make sense to drop this requirement so that people on non-Windows do not have to write CharSet.Ansi and scratch their head wondering what it means?

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Nov 6, 2021
@AaronRobinsonMSFT
Copy link
Member

Do we have a plan on what to do about CharSet, CharSet.Ansi in particular?

@jkotas Yep. The Interop team was discussing that. One of our current ideas involves the Encoding class and completely ignores the CharSet for GeneratedDllImport scenarios. We are still in preliminary discussions about it but will propose something soon.

@jkotas
Copy link
Member

jkotas commented Nov 7, 2021

One of our current ideas involves the Encoding class

I like this idea. It would allow us to handle all less common cases, without hardcoding them. But I think we should also have less verbose shortcuts or defaults for the most common cases (UTF16 on Windows, UTF8 on Unix, etc.). CharSet may be useful for these shortcuts.

@AaronRobinsonMSFT
Copy link
Member

Encoding proposal at #61326

@elinor-fung
Copy link
Member Author

Fields have been pared down and now match the API approved in #46822

@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants