© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
1 reply
BruceA

Why can't Visual Studio find this file?

StorageFile renderingConstantsStorage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///PelotonIDE\\Presentation\\RenderingConstants.json"));
StorageFile renderingConstantsStorage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///PelotonIDE\\Presentation\\RenderingConstants.json"));

That should work. I have two other JSON files that I load using the exact same syntax. But this file refuses to be found. One of the ones that work is
        public static async Task<InterpreterParametersStructure?> GetPerTabInterpreterParameters()
        {
            StorageFile tabSettingStorage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///PelotonIDE\\Presentation\\PerTabInterpreterParameters.json"));
            string tabSettings = File.ReadAllText(tabSettingStorage.Path);
            return JsonConvert.DeserializeObject<InterpreterParametersStructure>(tabSettings);
        }
        public static async Task<InterpreterParametersStructure?> GetPerTabInterpreterParameters()
        {
            StorageFile tabSettingStorage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///PelotonIDE\\Presentation\\PerTabInterpreterParameters.json"));
            string tabSettings = File.ReadAllText(tabSettingStorage.Path);
            return JsonConvert.DeserializeObject<InterpreterParametersStructure>(tabSettings);
        }

but the one that doesn't is
        public static async Task<RenderingConstantsStructure?> GetJSONRenderingConstants()
        {
            StorageFile renderingConstantsStorage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///PelotonIDE\\Presentation\\RenderingConstants.json")); // \Presentation\RenderingConstants.json
            string renderingConstantsJson = File.ReadAllText(renderingConstantsStorage.Path);
            return JsonConvert.DeserializeObject<RenderingConstantsStructure>(renderingConstantsJson);
        }
        public static async Task<RenderingConstantsStructure?> GetJSONRenderingConstants()
        {
            StorageFile renderingConstantsStorage = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///PelotonIDE\\Presentation\\RenderingConstants.json")); // \Presentation\RenderingConstants.json
            string renderingConstantsJson = File.ReadAllText(renderingConstantsStorage.Path);
            return JsonConvert.DeserializeObject<RenderingConstantsStructure>(renderingConstantsJson);
        }

The file is present in the folder
 Directory of C:\Users\bugma\Source\Repos\Present\Ptarmigan\PelotonIDE\PelotonIDE\Presentation

11/03/2024  01:37 PM               496 FactorySettings.json
11/03/2024  12:37 PM         2,749,458 LanguageConfiguration.json
11/03/2024  01:38 PM             4,148 PerTabInterpreterParameters.json
11/03/2024  11:44 AM               126 RenderingConstants.json
               4 File(s)      2,754,228 bytes
               0 Dir(s)  250,172,039,168 bytes free
 Directory of C:\Users\bugma\Source\Repos\Present\Ptarmigan\PelotonIDE\PelotonIDE\Presentation

11/03/2024  01:37 PM               496 FactorySettings.json
11/03/2024  12:37 PM         2,749,458 LanguageConfiguration.json
11/03/2024  01:38 PM             4,148 PerTabInterpreterParameters.json
11/03/2024  11:44 AM               126 RenderingConstants.json
               4 File(s)      2,754,228 bytes
               0 Dir(s)  250,172,039,168 bytes free

The properties for all the JSON files are the same. So why doesn't the program find the file?
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

❔ Visual Studio Can't Find .NET SDK?
C#CC# / help
4y ago
✅ visual studio code can't recover design
C#CC# / help
12mo ago
❔ Can't launch the Visual Studio Installer.
C#CC# / help
3y ago
❔ Can't succesfully run visual studio project
C#CC# / help
3y ago