0

I built a tool to process files from windows local appdata folders in the controller part and the tool is working fine while run in local.... I deployed this site on Azure web service app and I am not able to fetch the files. Is there any settings needed to configure to fetch the appdata folders/permissions?

code where I am fetching local folders:

    [HttpPost]
    public void FetchTheFile(String FilterVariables)
    {
        Request.InputStream.Seek(0, SeekOrigin.Begin);
        StreamReader sr = new StreamReader(Request.InputStream);
        string srrr = sr.ReadToEnd();
        var settings = new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore };
        FilterVariables FV = JsonConvert.DeserializeObject<FilterVariables>(srrr, settings);
        try
        {

            //Deserialize();
            string appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            string filePath = Path.Combine(appDataFolder, "CRM\\Logs\\Outlook.log");

            if (System.IO.File.Exists(filePath))
            {

                Stream stream = System.IO.File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                StreamReader streamReader = new StreamReader(stream);
                str = streamReader.ReadToEnd();
                str = "<?xml version=\"1.0\" encoding=\"utf - 8\"?><LOGS>" + str + "</LOGS>";
                str = Regex.Replace(str, @"[\u0000-\u001F]", string.Empty);

                XmlSerializer serializer = new XmlSerializer(typeof(Models.LOGS));
                Models.LOGS logs = new Models.LOGS();
                StringReader strReader = new StringReader(str);
                XmlTextReader xmlReader = new XmlTextReader(strReader);
  • I have now put up the code. Please check this – VasudhaMSR Jan 26 '17 at 19:13
  • What is the value of `appDataFolder` when on azure? – Scott Chamberlain Jan 26 '17 at 19:22
  • I am not able to debug from azure...when i try to publich with debug ...I dont have any dbconnections in the solution..I am now getting this runtime error System.ComponentModel.Win32Exception: The system cannot find the file specified http://stackoverflow.com/questions/20463119/the-system-cannot-find-the-file-specified – VasudhaMSR Jan 26 '17 at 19:51

0 Answers0