System.IO.IOException' occurred in mscorlib.dll

P

Paul Ilacqua

In running vb.net and I cannot get the System.IO.File.Delete(sFile) to work.
It throws the following exception. I'm developing using

"An unhandled exception of type 'System.IO.IOException' occurred in
mscorlib.dll"

I'm positive the file is not in use, Im developing with the Pocket PC 2003
emulator. I get the same error either on my device or on the emulator. It
compiles fine... does the .net compact framework not support file deletes?
Please Help... Thanks

Paul
 
I

Ilya Tumanov [MS]

Make sure you're using full path to the file as Win CE does not have
"current folder" concept.
Also, make sure file is not read only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
P

Paul Ilacqua

Here is the code sample......

Dim sw As StreamWriter = New StreamWriter(sFile)
Dim ErrorMessage As String

Try
'Fails Here *********************************

If System.IO.File.Exists(sFile) Then System.IO.File.Delete(sFile)

Dim s As String = "Test Message"

Catch ex As Exception

MsgBox(ex.ToString)

End Try

sw.Write(s)

sw.Close()

MessageBox.Show(File.Exists(sFile))


"Ilya Tumanov [MS]" said:
Make sure you're using full path to the file as Win CE does not have
"current folder" concept.
Also, make sure file is not read only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Paul Ilacqua" <[email protected]>
Subject: System.IO.IOException' occurred in mscorlib.dll
Date: Tue, 1 Feb 2005 18:29:08 -0500
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: cpe-24-92-230-236.twcny.res.rr.com 24.92.230.236
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:70261
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

In running vb.net and I cannot get the System.IO.File.Delete(sFile) to work.
It throws the following exception. I'm developing using

"An unhandled exception of type 'System.IO.IOException' occurred in
mscorlib.dll"

I'm positive the file is not in use, Im developing with the Pocket PC 2003
emulator. I get the same error either on my device or on the emulator. It
compiles fine... does the .net compact framework not support file
deletes?
Please Help... Thanks

Paul
 
I

Ilya Tumanov [MS]

If you're deploying this file via VS and you're using some source control,
this file is likely to be read only. Is it?

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Paul Ilacqua" <[email protected]>
References: <[email protected]>
Subject: Re: System.IO.IOException' occurred in mscorlib.dll
Date: Wed, 2 Feb 2005 15:53:06 -0500
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: cpe-24-92-230-236.twcny.res.rr.com 24.92.230.236
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15
..phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:70351
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Here is the code sample......

Dim sw As StreamWriter = New StreamWriter(sFile)
Dim ErrorMessage As String

Try
'Fails Here *********************************

If System.IO.File.Exists(sFile) Then System.IO.File.Delete(sFile)

Dim s As String = "Test Message"

Catch ex As Exception

MsgBox(ex.ToString)

End Try

sw.Write(s)

sw.Close()

MessageBox.Show(File.Exists(sFile))


"Ilya Tumanov [MS]" said:
Make sure you're using full path to the file as Win CE does not have
"current folder" concept.
Also, make sure file is not read only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Paul Ilacqua" <[email protected]>
Subject: System.IO.IOException' occurred in mscorlib.dll
Date: Tue, 1 Feb 2005 18:29:08 -0500
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: cpe-24-92-230-236.twcny.res.rr.com 24.92.230.236
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:70261
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

In running vb.net and I cannot get the System.IO.File.Delete(sFile) to work.
It throws the following exception. I'm developing using

"An unhandled exception of type 'System.IO.IOException' occurred in
mscorlib.dll"

I'm positive the file is not in use, Im developing with the Pocket PC 2003
emulator. I get the same error either on my device or on the emulator. It
compiles fine... does the .net compact framework not support file
deletes?
Please Help... Thanks

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top