locked
PathIO.ReadTextAsync error 'Access denied' RRS feed

  • Question

  • Hello.

    I have created a C # DLL for Windows Store App.

    I tested the DLL I created for testing the Windows Store App.

    I wanted to read and parse xml file on my computer.

    However, an error has occurred.

    Error code is 'Access denied' (HRESULT 0x80070005) in PathIO.ReadTextAsync function.

    private async Task<String> GetXmlFile(String xmlFileName)
    {
        String resString = null;
    
        try
        {
            String xmlFileString = await Windows.Storage.PathIO.ReadTextAsync(xmlFileName);   // error occured
            resString = xmlFileString;
        }
        catch(Exception ex)
        {
            SystemDiagnostics.Debug.WriteLine("Exception! - " + ex.ToString());
        }
    
        return resString;
    }


    I have tested the DLL in Windows Tablet PC simulator.

    The Argument, 'xmlFileName' is @"D:\Dev\DllTester\bin\Debug\test.xml"

    It is not read only file, and the folder is not system folder, too.

    I'm trying for days but could not find the cause.

    I'm sorry I did not speak English well, so I used a translator in internet.

    I need help, please.

    Thank you.

    Wednesday, October 30, 2013 8:07 AM

Answers

All replies