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

How to avoid conditional compilation when using Designer attribute? #37

Open
valiahmetovv opened this issue May 2, 2024 · 0 comments
Open

Comments

@valiahmetovv
Copy link

He @KlausLoeffelmann

I have a component which requires both net462 and .NET design time support, so i have created stub RootDesigners for net462 and .NET, but i cant apply them without conditionall compilation

The following line seems to work only for net462 environment.
[Designer("Server.CompoundObjectRootDesigner", typeof(IRootDesigner)), ToolboxItem(false)]

In .NET environment it leads to the following error:
image

So for .NET i have to use this, but it will not work in net462 environment:
[Designer("CompoundObjectRootDesigner", typeof(IRootDesigner)), ToolboxItem(false)]

Is it possible to support same convention for both targets? Or is conditional compilation the recommended approach:
#if NET462
[Designer("Server.CompoundObjectRootDesigner", typeof(IRootDesigner)),
ToolboxItem(false)]
#else
[Designer("CompoundObjectRootDesigner", typeof(IRootDesigner)),
ToolboxItem(false)]
#endif

Thanks

@valiahmetovv valiahmetovv changed the title Designer attribute not working with namespace How to avoid conditional compilation when using Designer attribute? May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant