Re: Strange problem when not in debugger



Hi Peter,

The error is: The type-initialisation function for System.Uri has made an exception

private void Upload(string filename, string FTnaam) // filename @"c:\'map\somefile.pdf FTnaam /backup/map/somefile.pdf
{
FileInfo fileInf = new FileInfo(filename);

string uri = "ftp://"; + F1.FTPserver + FTnaam; // ftp:///ftp.someserver.nl/backup/map/somefile.pdf
FtpWebRequest reqFTP;

// Create FtpWebRequest object from the Uri provided
reqFTP = (FtpWebRequest) FtpWebRequest.Create(new Uri("ftp://"; + F1.FTPserver + FTnaam)); // error

The maps are already created by another routine that is working.

"Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx> schreef in bericht news:op.t89qwkqz8jd0ej@xxxxxxxxxxxxxxxxxxxxxxx
On Mon, 07 Apr 2008 15:00:59 -0700, Rinaldo <zwartehoofdpiet@xxxxxxxxxxxxxxxxxx> wrote:

Hi,

When I start my program in the debugger, there is no problem, but when not I get an exception.

What exception do you get? What are the values you're passing to the Create() method?

It's possible that with answers to those questions, an explanation can be given. But if not, you're going to have to post a concise-but-complete code sample that reliably demonstrates the problem.

Pete

.



Relevant Pages

  • Re: Crystal Reports Type Initialization Error on CRPE (Reporting Engine)
    ... The type initializer for "CrystalDecisions.CrystalReports.Engine.CRPE" ... threw an exception. ... filename, OpenReportMethod openMethod, Int16 parentJob) ... and I also recall reading recently that one of the more recent MS ...
    (microsoft.public.vb.crystal)
  • another NullPointerException problem with List interface
    ... The API says that addcan have this exception "if the ... prints out the filename). ... 45 public static ListlistAllFiles(File dir, String ... extension) throws Exception ...
    (comp.lang.java.programmer)
  • Re: mwArray string - convert in m file???
    ... to access matlab code in a compiled dll the code I posted ... I keep getting an exception though... ... IS there something else I need to do with the filename? ...
    (comp.soft-sys.matlab)
  • Re: Out of memory eventhough Garbage collection is in the code
    ... After calling this function 190 times, i get an exception at the point of exception. ... System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) at ... essageClass& displayObject, String fileName, String startingPageNum, String fileExt) in ... It's possible that the error comes from a corrupt file instead of an actual lack of memory. ...
    (microsoft.public.dotnet.languages.vb)
  • exception
    ... As i am i dummy user trying to debug a dummy application i've got a ... exception thrown at a very basic piece of code: ... public static Image LoadImage(string Filename) ...
    (microsoft.public.dotnet.framework.compactframework)

Loading