I am working on a JavaScript metro application, and I found out that to call a C# code from JavaScript I have to use Windows Runtime Component project in my solution. Now I need to check some image which are added in the JavaScript metro application in "images" folder and if they are there I need to copy them in the application local folder.
First I tried using the method
Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///images/logo.png"))
but it throws exception that could not find the location/ file path.
I thought it might be because the namespaces of project are different. The image is added in JavaScript metro application project and I am trying to use it from a Windows Runtime Component project.
So I tried passing a hard coded path for the image file like "E://projects/myProject/myProject/images/logo.png", and tried with method
Windows.Storage.StorageFile.GetFileFromPathAsync(<passed the above path>);
but it throws exception that file path is not correct format.
Can I access a file added in JavaScript metro application project from Windows Runtime Component project in the same solution? And copy it in the application local folder?
thanks.