© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
39 replies
Nohxi

✅ Directory path

Hi, In the appsettings.json file, I've specified a specific path to the data.json file. Unfortunately, the file cannot be found at the provided path:
"Path": "/Users/an/Desktop/Development/Project/Project.Api/App_data/data.json". 
"Path": "/Users/an/Desktop/Development/Project/Project.Api/App_data/data.json". 


The error message indicates:
System.IO.DirectoryNotFoundException: Could not find a part of the path '/Library/Frameworks/Mono.framework/Commands:/Applications/Visual Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/usr/local/bin:~/.dotnet/tools:/usr/local/share/dotnet'. 
System.IO.DirectoryNotFoundException: Could not find a part of the path '/Library/Frameworks/Mono.framework/Commands:/Applications/Visual Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/usr/local/bin:~/.dotnet/tools:/usr/local/share/dotnet'. 


Occurring on the following code when trying to deserialize:

string fullPath = Path.Combine(parameters.Path);
string fullPath = Path.Combine(parameters.Path);


 var json = File.ReadAllText(fullPath);
 var json = File.ReadAllText(fullPath);


var searchMethod = JsonConvert.DeserializeObject<List<DefinitionJson>>(json);
var searchMethod = JsonConvert.DeserializeObject<List<DefinitionJson>>(json);


I'm using an iOS operating system. Looking forward to a reply 🙂
Screenshot_2024-03-25_at_16.20.03.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Directory.CreateDirectory() for a file path while ignoring the filename
C#CC# / help
3y ago
✅ Get full paths to executables in %PATH%
C#CC# / help
3y ago
Directory Copy
C#CC# / help
2y ago