473,657 Members | 2,934 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 1828

"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
3333
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
3422
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
3086
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
7161
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
3315
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
13295
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
2473
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
24539
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
2399
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
8384
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8820
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
8718
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
8499
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,...
1
6162
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
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.