Is there an attribute (or another method) to hide an interface (in a dll)
from being seen from the object browser while browsing a dll?
Thanks in advance,
pnp 7 1820
Hi,
Do not make it public.
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:OG**************@TK2MSFTNGP10.phx.gbl... Is there an attribute (or another method) to hide an interface (in a dll) from being seen from the object browser while browsing a dll?
Thanks in advance, pnp
The problem is that it has to be public because it is being used by other
assemblies... The need to hide it is for security reasons.
Can anything be done?
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uh**************@TK2MSFTNGP11.phx.gbl... Hi,
Do not make it public.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:OG**************@TK2MSFTNGP10.phx.gbl... Is there an attribute (or another method) to hide an interface (in a
dll) from being seen from the object browser while browsing a dll?
Thanks in advance, pnp
pnp,
Even if you were able to hide it from an object browser, the metadata
for the interface could still be read (if you have to make it public, then
there is nothing you can do about this).
However, if you are dealing with object browsers that use the Reflection
API, then you can probably place a ReflectionPermission attribute on your
types, denying the permission. This should offer some sort of protection.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:e9**************@TK2MSFTNGP15.phx.gbl... The problem is that it has to be public because it is being used by other assemblies... The need to hide it is for security reasons.
Can anything be done? "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:uh**************@TK2MSFTNGP11.phx.gbl... Hi,
Do not make it public.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:OG**************@TK2MSFTNGP10.phx.gbl... > Is there an attribute (or another method) to hide an interface (in a dll) > from being seen from the object browser while browsing a dll? > > Thanks in advance, > pnp > >
I'll give it a try, thank you both.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP15.phx.gbl... pnp,
Even if you were able to hide it from an object browser, the metadata for the interface could still be read (if you have to make it public, then there is nothing you can do about this).
However, if you are dealing with object browsers that use the
Reflection API, then you can probably place a ReflectionPermission attribute on your types, denying the permission. This should offer some sort of protection.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:e9**************@TK2MSFTNGP15.phx.gbl... The problem is that it has to be public because it is being used by
other assemblies... The need to hide it is for security reasons.
Can anything be done? "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:uh**************@TK2MSFTNGP11.phx.gbl... Hi,
Do not make it public.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:OG**************@TK2MSFTNGP10.phx.gbl... > Is there an attribute (or another method) to hide an interface (in a dll) > from being seen from the object browser while browsing a dll? > > Thanks in advance, > pnp > >
Could you post me an example because I didn't have any luck by trying it my
self?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP15.phx.gbl... pnp,
Even if you were able to hide it from an object browser, the metadata for the interface could still be read (if you have to make it public, then there is nothing you can do about this).
However, if you are dealing with object browsers that use the
Reflection API, then you can probably place a ReflectionPermission attribute on your types, denying the permission. This should offer some sort of protection.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:e9**************@TK2MSFTNGP15.phx.gbl... The problem is that it has to be public because it is being used by
other assemblies... The need to hide it is for security reasons.
Can anything be done? "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:uh**************@TK2MSFTNGP11.phx.gbl... Hi,
Do not make it public.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:OG**************@TK2MSFTNGP10.phx.gbl... > Is there an attribute (or another method) to hide an interface (in a dll) > from being seen from the object browser while browsing a dll? > > Thanks in advance, > pnp > >
Nicholas,
Do you have any evidence that denying ReflectionPermission (or any flag
subset) via an attribute at the class or member level has any effect at all?
I've tested quite a few variations on the theme (incl. imperative denial of
the permission), and I've never seen any effect on member discoverability or
accessibility via reflection.
It could be that the reflection methods are asserting the permission after
an initial stack walk to determine if the desired activity is permitted to
the callers. This would make sense in an odd sort of way since the
ReflectionPermission settings for the target can't be determined until after
it's already been loaded. That said, it would still be terribly
inconsistent with the expected behaviour for a CAS permission...
Nicole
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP15.phx.gbl... pnp,
Even if you were able to hide it from an object browser, the metadata for the interface could still be read (if you have to make it public, then there is nothing you can do about this).
However, if you are dealing with object browsers that use the Reflection API, then you can probably place a ReflectionPermission attribute on your types, denying the permission. This should offer some sort of protection.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:e9**************@TK2MSFTNGP15.phx.gbl... The problem is that it has to be public because it is being used by other assemblies... The need to hide it is for security reasons.
Can anything be done? "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:uh**************@TK2MSFTNGP11.phx.gbl... Hi,
Do not make it public.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:OG**************@TK2MSFTNGP10.phx.gbl... > Is there an attribute (or another method) to hide an interface (in a dll) > from being seen from the object browser while browsing a dll? > > Thanks in advance, > pnp > >
Actually, ignore the second paragraph of my last post entirely. The
framework almost certainly doesn't need an assertion to prevent the deny
from working since there's no need for ReflectionPermission to be evaluated
after the target is loaded. In fact, to be consistent with the other
permissions, stack walk modifiers on the target class or member should
probably be ignored. For example, a file doesn't get to specify a modifier
for a FileIOPermission (ignoring the fact that there's no mechanism in place
for this <g>), so why should code get to specify a modifier for
ReflectionPermission? Doesn't mean I necessarily like the behaviour, but
there is a certain logic to it.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP15.phx.gbl... pnp,
Even if you were able to hide it from an object browser, the metadata for the interface could still be read (if you have to make it public, then there is nothing you can do about this).
However, if you are dealing with object browsers that use the Reflection API, then you can probably place a ReflectionPermission attribute on your types, denying the permission. This should offer some sort of protection.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:e9**************@TK2MSFTNGP15.phx.gbl... The problem is that it has to be public because it is being used by other assemblies... The need to hide it is for security reasons.
Can anything be done? "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:uh**************@TK2MSFTNGP11.phx.gbl... Hi,
Do not make it public.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message news:OG**************@TK2MSFTNGP10.phx.gbl... > Is there an attribute (or another method) to hide an interface (in a dll) > from being seen from the object browser while browsing a dll? > > Thanks in advance, > pnp > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: gokul |
last post by:
Hi,
Iam a newbie to dotnet and I experience problems in using the Browser
control in VB .net. Though Iam able to use it with its basic features,
I need to customise it.
...
|
by: Ron Liu |
last post by:
Hi all,
How to hide methods of interface? All the MSDN said it is not possible. I
also did lots of tests, and got the same answer.
However, I found there are some classes in .net framework did...
|
by: Ray Z |
last post by:
hi, there
I build a Class Library, I write a class A to implement interface IA. The
problem is when I give the dll file to others, thet can get all information
about not only IA, but also A. They...
|
by: C-Sharper or C-Hasher, one of the two |
last post by:
Hi,
I have a C# class libary (Class1) which is inherited by another class in a
Windows Forms app. I want this other class to implement some, but not all of
the features of the base class. How...
|
by: Alex Sedow |
last post by:
Example 1
interface I
{
string ToString();
}
public class C : I
{
public void f()
{
|
by: Laurent Vigne |
last post by:
Hello, I would like to know how to make the methods of an interface
inaccessible from outside
Example:
----------------------------------------------
internal Interface ImyInterface
{
void...
|
by: Øyvind Isaksen |
last post by:
Is it possible to show/hide a usercontrol code behind?
<uc1:topart id="Topart1" runat="server"></uc1:topart>
This is what i want to do, but this does not work:
if objDR.read
me.Topart1.show...
|
by: jimstruckster |
last post by:
I have a table with 10 rows, I want all rows except for the first to be
hidden when the page first opens up. If the user puts a value in a
text box in the first row then I want the second row to...
|
by: Ralph |
last post by:
Hi,
I was reading effictive C++ and some other books again and they all tell
you about hiding implementation details (proxy/pimpl/inheritance) but
they never really explain when to use it.
I...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |