Relative path issue
I am trying to read some Json files and parse them with one of my services. Locally it works fine.
I've tried 3 different methods of determining the path and all of them have the same path issue
So here is my deployment log message
here is my path creation that works locally in dev mode
string jsonFilePath = Path.Combine("wwwroot", "json", "homecoming", "boost_sets", $"{enhancementName}.json");
string jsonFilePath = "wwwroot/json/homecoming/boost_sets/" + enhancementName + ".json";
string webRootPath = _env.WebRootPath;
string jsonFilePath = Path.Combine(webRootPath, "json", "homecoming", "boost_sets", $"{enhancementName}.json");
All three above work locally just fine and all 3 give me the same error when deployed17 Replies
Project ID:
740eb4a0-07aa-4fed-aac4-d9d5028a12b8
Project Id:
740eb4a0-07aa-4fed-aac4-d9d5028a12b8
can we be sure this file or folder its in isnt being gitignored?
One moment, let me check
It is all there in my git repo
okay next question, how big are these json files
<100kb each
should
wwwroot
be www/root
?No, /wwwroot is correct
It doesn't seem to be finding the project dir maybe?
It is {project}/wwwroot/...
okay, can you share your repo so i can have a look at the folder structure?
Yes, sent via dm
#🛂|readme #5
this has no capital letters
this error does
Okay, I will see if that will fix it
Solution
the good old .toLowerCase()
@Brody much appreciated, that fixed it
no problem!