public void RemoveFromModelsGuide() { string StartPath = Directory.GetParent(Application.ExecutablePath).ToString(); // Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName; //---- File from where to read string EndingPath_ModelsGuide = @"\Resources\src\ModelsGuide.txt"; string ModelsGuideTxt = StartPath + EndingPath_ModelsGuide; //--- File where to write temporary string EndingPath_Temporary = @"\Resources\src\Temporary.txt"; string TemporaryTxt = StartPath + EndingPath_Temporary; try { Treatments.RemoveModelRewritingFile(this.ModelID, ModelsGuideTxt, TemporaryTxt); File.Delete(this.Content); } catch (Exception Ex) { Console.WriteLine("Error: " + Ex.Message); } }