Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
429 views
in Technique[技术] by (71.8m points)

c# - How to restrict the usage of property in another project

We have used one project as dll(common.dll) in both windows application and web application. We have defined one property(webProp) in common.dll. The webProp should visible only in web application only. That property should not visible in windows application.

Is there any way to do that?

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can make properties internal, and you would have to rely in InternalVisibleToAttribute to enable property to be visible in webproject and due to usage of internal attribute, its wouldn't be visible in window project.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...