Share via

error System.UnauthorizedAccessException: Access to the path 'C:\Program Files\WindowsApps\\Resources\a1.sip'

Anonymous
2021-12-18T13:52:14+00:00

I have publish a app that read png files and binary files from resources in

C:\Program Files\WindowsApps\name publisher\Mollier_Hvac_Simulation\Resources

Reading png files work well with:

 PictureBox1.BackgroundImage = My.Resources.a1 a1=picture png

But with binary file not:

 file_name = "a1.sip"      // is a binary file

Find directory resources :

 Dim resFolder As String = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "Resources")

then set CurrentDirectory :

 My.Computer.FileSystem.CurrentDirectory = resFolder

' Create the reader for data.

     Dim fs As New FileStream(file_name, FileMode.Open)

            Dim r As New BinaryReader(fs)

This works fine on mine computer but after publishing

i get no access to the file

System.UnauthorizedAccessException: Access to the path 'C:\Program Files\WindowsApps\Resources\a1.sip'

Only when i change the admin rights on the other computer then it works good.

But i can't change admin rights on computer of custumers.

Kindly Regards

Piet

Windows for home | Windows 10 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2021-12-18T14:30:01+00:00

Hi Piet

I am Dave, I will help you with this.

I apologize, Community is just a consumer forum, due to the scope of your question (App Development) can you please post this question to our sister forum on Microsoft Q&A (The Developers forum)

Over there you will have access to a host of App Developers and programming experts and will get a knowledgeable and quick answer to this question.

https://docs.microsoft.com/en-us/answers/index....

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful