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

Feature request: Option to set a custom namespace for the generated output instead of Windows.Win32 #1312

Closed
MatejKafka opened this issue Dec 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@MatejKafka
Copy link

Currently, I don't see any public way to change the namespace used for the generated C# code. I'm calling CsWin32 manually from PowerShell to access some Win32 APIs and since Add-Type does not allow loading parts of partial classes in separate invocations, running CsWin32 multiple times and loading the resulting C# code with Add-Type results in type collisions. Therefore, I'd like to be able to change the output namespace.

@MatejKafka MatejKafka added the enhancement New feature or request label Dec 9, 2024
@AArnott
Copy link
Member

AArnott commented Jan 15, 2025

I sympathize with the desire, but we're not going to deliver on this. We actually used to have this feature and had to remove it because the metadata itself has many namespaces, and combining all of them into one introduces API name conflicts. It also makes emitting code that calls into another generated API far more complicated.
We might revisit this at some point in the future, but at the moment, I want to set expectations that this is not likely to be delivered in the foreseeable future.

@AArnott AArnott closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants