473,706 Members | 2,301 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Possible to use an "internal" class in an external assembly?

I've got a third-party assembly dll containing an "internal" class with
some public methods I would very much like to use.

I understand the meaning and reason of setting the accessibility of the
class to internal. But is there any way, dirty or not, I could use this
class and its methods anyway?
Feb 17 '06 #1
6 1834

"John Nossluap" <no******@nodom ain.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I've got a third-party assembly dll containing an "internal" class with
some public methods I would very much like to use.

I understand the meaning and reason of setting the accessibility of the
class to internal. But is there any way, dirty or not, I could use this
class and its methods anyway?


You want to go out of your way to make your app unmaintainable and to ensure
that a third party can break it in weird and unpredictable ways just by
issuing an upgrade?

Try reflection.
Feb 17 '06 #2
Nick Hounsome wrote:
You want to go out of your way to make your app unmaintainable and to ensure
that a third party can break it in weird and unpredictable ways just by
issuing an upgrade?
Yah, I'm developing a proof-of-concept prototype for a small audience so
the application's ttl doesn't really matter ;)
Try reflection.


You know for sure its doable or is it just a wild guess?

Thanks for you answer.
Feb 17 '06 #3
Hi,

"John Nossluap" <no******@nodom ain.com> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
Nick Hounsome wrote:
You want to go out of your way to make your app unmaintainable and to
ensure that a third party can break it in weird and unpredictable ways
just by issuing an upgrade?


Yah, I'm developing a proof-of-concept prototype for a small audience so
the application's ttl doesn't really matter ;)
Try reflection.


You know for sure its doable or is it just a wild guess?


This is easily checkable, it would take you 10 min to write the code and
see if it works or not

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Feb 17 '06 #4
John Nossluap wrote:
Nick Hounsome wrote:
You want to go out of your way to make your app unmaintainable and to ensure
that a third party can break it in weird and unpredictable ways just by
issuing an upgrade?


Yah, I'm developing a proof-of-concept prototype for a small audience so
the application's ttl doesn't really matter ;)
Try reflection.


You know for sure its doable or is it just a wild guess?

Thanks for you answer.


It's doable so long as you're in a high trust environment - in other
words, if the system has been told to trust your code to do whatever it
likes, you should be fine.

Jon

Feb 17 '06 #5
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

This is easily checkable, it would take you 10 min to write the code and
see if it works or not


All truths are easy to understand once they are discovered; the point is
to discover them.
Feb 17 '06 #6
Jon Skeet [C# MVP] wrote:
John Nossluap wrote: It's doable so long as you're in a high trust environment - in other
words, if the system has been told to trust your code to do whatever it
likes, you should be fine.


Sounds acceptable, I'll give it a shot. Thanks.
Feb 17 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3337
by: Will Hartung | last post by:
I have this: <a class="pink_link" href="faq.html#q1">Go to question 1</a> And the CSS is simply: ..pink_link {color: #fa61b7; font-weight: bold;} So, I'm curious why my links are blue and not pink. All of my other "pink_links" are pink, but they don't link to anchors on the same page.
5
3427
by: BoonHead, The Lost Philosopher | last post by:
Does anyone know how to implement internal interface documentation for functions and parameters? I found a similair thing for proerties. For properties I found something like: <System.ComponentModal.Description("This property sets aars!")> Property Aars() As Boolean '...Property body... End Property
12
3090
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application { BACKGROUND-IMAGE:url(/someImage.jpg); }
5
7167
by: Andrew R. Thomas-Cramer | last post by:
Can I simply mark a class as internal, or should I change all its public members to internal as well? If I can mark the class only as internal, it makes modifications easy.
4
3320
by: David Sworder | last post by:
Consider the following line of code (it's not important what it does): resp.DocItem=Relations.SelectDocItems_BySearchString(req.SearchPhrase); It turns out that this line is in error. The property 'DocItem' should be 'DocItems.' The problem is that instead of notifying me of where the problem has occurred, the compiler just crashes with an "internal error" (see bottom of this message). Now if I were to write: ...
2
13299
by: Brian Henry | last post by:
Is there a .NET equivilent of the "internal" keyword in VB.NET? say if i had this in C# internal bool b_MyBoolean;
2
2476
by: Gnus | last post by:
Hi all! I have a little(?) problem with external schema location... I'm using xerces/xalan (C++) for doing some actions with some set of xml-files. Some of these files must validating against schema, which location specify in config file ("external" schema). Other files must be validating against schema, which location specify in parsed xml file (via xsi:shemaLocation attribute, "internal" schema) How can I switch between these ...
23
24557
by: ticfranca | last post by:
Hi, I'm getting this error in the code below: sub Pega_recorde { $database = 'bundinha'; $host = 'localhost'; $usuario = 'myhumoradm'; $senha = 'my8xr2d2'; $dbh=DBI->connect("DBI:mysql:database=$database;host=$host","$usuario","$senha") or die "Can't open DB: $!";
4
2402
by: ~~~ .NET Ed ~~~ | last post by:
I am facing a problem. My project is composed of several assemblies. In one of them -the backend- I have several internal classes that must implement an interface. These internal classes are only used by one master class that is public. I am able to declare the interface as "internal interface" without problem but when I attempt to use it by declaring a class that implements it, if I declare the implemented interface members as...
0
8696
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9285
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9155
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9050
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6614
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4709
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2094
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.