Re: can't write to newly created file - file being used by another process
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 19 Oct 2005 16:42:29 -0400
Hmm, I thought XmlTextWriter derived from TextWriter (odd that it
doesn't). Oh well, we were both right, I was referring to 2.0.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1dc0bd5b95f2bd8898c960@xxxxxxxxxxxxxxxxxxxxxxx
> Nicholas Paldino [.NET/C# MVP] <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>> XmlTextWriter does implement IDisposable. Jon was being sarcastic.
>
> No, I wasn't, and it doesn't - in 1.1. Try it:
>
> using System;
> using System.Xml;
> using System.Text;
>
> public class Test
> {
> static void Main()
> {
> using (XmlTextWriter x = new XmlTextWriter("test.xml",
> Encoding.UTF8))
> {
> }
> }
> }
>
> gives the error:
>
> Test.cs(9,9): error CS0029: Cannot implicitly convert type
> 'System.Xml.XmlTextWriter' to 'System.IDisposable'
>
> It works fine for 2.0, but I suspect most people aren't using that
> yet...
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
.
- References:
- can't write to newly created file - file being used by another process
- From: Dica
- Re: can't write to newly created file - file being used by another process
- From: Jon Skeet [C# MVP]
- can't write to newly created file - file being used by another process
- Prev by Date: Re: can't write to newly created file - file being used by another process
- Next by Date: Circular Dependency on References
- Previous by thread: Re: can't write to newly created file - file being used by another process
- Next by thread: Re: can't write to newly created file - file being used by another process
- Index(es):
Relevant Pages
|