Anton Shepelev
2017-09-28 09:57:46 UTC
Hello, all
Can you please explain to me why the following code
doesn't compile in .NET 3.5:
ResourceReader rr;
rr = new ResourceReader( @"dummy.resources" );
rr.Dispose();
with error:
'ResourceReader' does not contain a definition for
'Dispose' and no extension method 'Dispose' ac-
cepting a first argument of type 'ResourceReader'
could be found (are you missing a using directive
or an assembly reference?)
whereas the following compiles and works:
ResourceReader rr;
IDisposable id;
rr = new ResourceReader(@"dummy.resources");
id = rr as IDisposable;
id.Dispose();
Can you please explain to me why the following code
doesn't compile in .NET 3.5:
ResourceReader rr;
rr = new ResourceReader( @"dummy.resources" );
rr.Dispose();
with error:
'ResourceReader' does not contain a definition for
'Dispose' and no extension method 'Dispose' ac-
cepting a first argument of type 'ResourceReader'
could be found (are you missing a using directive
or an assembly reference?)
whereas the following compiles and works:
ResourceReader rr;
IDisposable id;
rr = new ResourceReader(@"dummy.resources");
id = rr as IDisposable;
id.Dispose();
--
() ascii ribbon campaign - against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]
() ascii ribbon campaign - against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]