|
I'am send a xml file using threads and backgroundWorker control. Source: try { backgroundWorker.RunWorkerAsync(Path.Combine(Application.StartupPath, "file.xml")); } private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; NameValueCollection config = ConfigurationManager.AppSettings; UploadHelper.HttpFileTransfer(e.Argument.ToString(), config["uri"]); } in UploadHelper public static void HttpFileTransfer(string path, string uri) { WebClient client = new WebClient(); Uri currentUri = new Uri(uri); FileInfo info = new FileInfo(path); string filename = info.Name; client.UploadFile(currentUri, "POST", filename); } When i starting release i get an FileNotFound Exception with path -> D:\ProjectRoot\ProjectFolder\file.xml. But my path contains D:\ProjectRoot\ProjectFolder\bin\Release\file.xml Why can this happen? Thank's |