Click here to Skip to main content
15,888,461 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Generalwhat software must I use.. Pin
mrAndy23-Jan-03 19:30
mrAndy23-Jan-03 19:30 
GeneralPros and Cons of using .NET Pin
Nick Blumhardt22-Jan-03 14:16
Nick Blumhardt22-Jan-03 14:16 
GeneralRe: Pros and Cons of using .NET Pin
Christian Graus22-Jan-03 14:37
protectorChristian Graus22-Jan-03 14:37 
GeneralRe: Pros and Cons of using .NET Pin
Nick Blumhardt22-Jan-03 15:04
Nick Blumhardt22-Jan-03 15:04 
GeneralRe: Pros and Cons of using .NET Pin
Stephane Rodriguez.24-Jan-03 21:36
Stephane Rodriguez.24-Jan-03 21:36 
GeneralRe: Pros and Cons of using .NET Pin
TigerNinja_5-Feb-03 5:22
TigerNinja_5-Feb-03 5:22 
QuestionIStream implementation (COM) How to release base .NET Stream ? Pin
cornelos22-Jan-03 4:41
cornelos22-Jan-03 4:41 
GeneralPlease tell me they're joking... Pin
Richard Deeming22-Jan-03 0:50
mveRichard Deeming22-Jan-03 0:50 
... or that I'm being thick.

I've just read the list of breaking changes for v1.1 of the framework: http://www.gotdotnet.com/team/changeinfo/Backwards1.0to1.1/[^]

There's nothing too bad, until you get to http://www.gotdotnet.com/team/changeinfo/Backwards1.0to1.1/default.aspx#00000139[^]:

Calling a method through a Delegate performs the same accessibility checks as calling that method directly

Description: The common language runtime allows method C.MethC() to call method A.MethA() only if A.MethA() is both visible and accessible to the caller.
In particular, if A.MethA() has accessibility "protected", then the call will only succeed if class C is derived from class A.
However, this check was skipped when the call was performed through a Delegate. This bug has now been fixed so that calling a method either directly or through a Delegate follows the same rules for visibility and accessibility.

Workaround: Change the accessibility of the target method so that it is legitimately accessible to the caller.


As I read it, this means that:
  • every event handler;
  • every AsyncCallback method;
  • every ThreadStart and WaitCallback method;
  • every utility class used to pass state to a thread;
  • etc...
has to be made public, since the code which invokes the method is in a different assembly, and is not derived from your class. WTF | :WTF: Mad | :mad:

For example, instead of:
public class SimpleForm : Form
{
    private TextBox _textbox;
    ...
    
    private void textbox_TextChanged(object sender, EventArgs e)
    {
        // Do something here
    }
    
    public string TheText
    {
        get { return _textbox.Text; }
    }
}
you now need:
public class SimpleForm : Form
{
    private TextBox _textbox;
    ...
    
    public void textbox_TextChanged(object sender, EventArgs e)
    {
        // Check to make sure this method is being called
        // from the event on the textbox, and not a user
        // trying to find out what this method does.
        if ( ... )
        {
            // Do something here
        }
    }
    
    public string TheText
    {
        get { return _textbox.Text; }
    }
}


I don't claim to be an OO expert, but this seems to throw out the concept of encapsulation. The public interface of your class will be clogged up with event handlers for private objects, callbacks for threads and asynchronous operations, etc. Not to mention the fact that this will break all non-trivial version 1 apps, since these methods are usually declared as private or protected.

If anyone from Microsoft is reading this, or anyone has used v1.1, please tell me I'm seeing things and that this "fix" doesn't mean what it sounds like it means. Because if it does, I don't think I'll be upgrading. Frown | :(


"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
GeneralRe: Please tell me they're joking... Pin
Sijin22-Jan-03 3:31
Sijin22-Jan-03 3:31 
GeneralRe: Please tell me they're joking... Pin
Richard Deeming22-Jan-03 3:40
mveRichard Deeming22-Jan-03 3:40 
GeneralOK, so I'm thick! Pin
Richard Deeming22-Jan-03 5:18
mveRichard Deeming22-Jan-03 5:18 
Generalplz help urgent for setup !! Pin
drmzunlimited21-Jan-03 23:21
drmzunlimited21-Jan-03 23:21 
GeneralRe: plz help urgent for setup !! Pin
Vasudevan Deepak Kumar23-Jan-03 1:16
Vasudevan Deepak Kumar23-Jan-03 1:16 
GeneralHandling events raised by a COM component in a Windows Service developed in .NET Pin
Anonymous20-Jan-03 4:21
Anonymous20-Jan-03 4:21 
GeneralRe: Handling events raised by a COM component in a Windows Service developed in .NET Pin
Stephane Rodriguez.21-Jan-03 11:02
Stephane Rodriguez.21-Jan-03 11:02 
Generalwriting a game in .net Pin
joooooooe20-Jan-03 3:00
joooooooe20-Jan-03 3:00 
GeneralRe: writing a game in .net Pin
Tomas Petricek21-Jan-03 10:28
Tomas Petricek21-Jan-03 10:28 
GeneralComparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN Pin
Ingram Leedy18-Jan-03 12:15
Ingram Leedy18-Jan-03 12:15 
GeneralDesigners/CodeDOM Pin
CAR17-Jan-03 10:03
CAR17-Jan-03 10:03 
GeneralDeploying a .NET app Pin
antoine@orchus-tech17-Jan-03 3:59
antoine@orchus-tech17-Jan-03 3:59 
GeneralRe: Deploying a .NET app Pin
Joel Matthias17-Jan-03 5:16
Joel Matthias17-Jan-03 5:16 
QuestionBug in Bitmap class? Pin
Stan Shannon17-Jan-03 2:29
Stan Shannon17-Jan-03 2:29 
AnswerRe: Bug in Bitmap class? Pin
leppie17-Jan-03 7:23
leppie17-Jan-03 7:23 
GeneralRe: Bug in Bitmap class? Pin
Stan Shannon17-Jan-03 9:03
Stan Shannon17-Jan-03 9:03 
GeneralBidirectional TCP Genuine Channels are Available. Pin
Bill200217-Jan-03 0:12
Bill200217-Jan-03 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.