dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.72k forks source link

Accessing Deployment Files #23833

Open jbeen25 opened 1 month ago

jbeen25 commented 1 month ago

Description

This seems to be a long-standing issue of not being able to access an assortment of files that are deployed with the application: SQLite, images, binary, (anything that is not text-based).

I am presuming the only solution around this is creating a Rest API or FTP server and downloading content to csharp FileSystem.AppDataDirectory; even though, they are relatively tiny files.

I have created a small project to test some theories with no success in getting around this so far.

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/jbeen25/AccessDeployedFiles

Version with bug

9.0.0-preview.6.24327.7

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

RoiChen001 commented 1 month ago

I can repro this issue at Windows platform on the latest 17.11.0 Preview 5.0 (9.0.0-preview.6.24327.7&8.0.70).

jfversluis commented 1 month ago

You have some extra clutter that describes these files and might interfere with how the resources are added.

If you remove these, does that change anything?

jbeen25 commented 1 month ago

You have some extra clutter that describes these files and might interfere with how the resources are added.

If you remove these, does that change anything?

Yes, it now works. I honestly can't believe it was that simple.

Here are the steps I took, which automatically created this code: 1) Select any file from File Explorer. 2) Drag the selected file to Visual Studios->Solution Explorer. 3) Drop the file in the Raw folder.

This automatically triggers an event within Visual Studios to edit project code adding the following lines you have pointed out.

Thank you for helping solve this silly problem; hopefully, others will find this when they stumble on it as well.