Using litjson as text document in monodevelop
Hi there, So I've asked this before but someone told me to make a new SPECIFIC question and word it a bit more clear. I need to create a file in my StreamingAssets folder called Items.json. I have litjson library installed, but my files directory doesn't recognize the .JSON file type. So since when I try to open the file in Unity to open in my monodevelop, it just opens in notepad. So then I opened it directly into Monodevelop by just doing open > file > items.json.txt. Then I can code in the file just fine. But will the .txt ending affect the outcome?
Sorry, but you question is really not Unity-specific. It's more of how files are handled. ;)
but my files directory doesn't recognize the .JSON file type
That sounds ridiculous. You can create files with almost any name and/or extension. The limitations are based on your OS.
So since when I try to open the file in Unity to open in my monodevelop, it just opens in notepad.
Unity provides you a way to setup how to handle files you are opening. If you open Edit -> Preferences and go on a External Tools section, you can get what I'm talking about. But there are only a few options.
In case Unity has no idea how to open the file, it just handles file opening to your OS. Which decides to open it with a notepad in your case.
However you can open your $$anonymous$$ono Develop and open your .json file simply by File -> Open. It worked for me and will work for you for sure, if I understood right what you want to do.
Notice that you don't need to change your .json-file's extension to .txt or whatever else. You have to understand that file extensions are just parts of the files' names that help to figure out how to handle those files.
Hope that helps. Ask if you have any questions left.
Ok, that makes sense. Thanks! So would I need to update the file name in my Item database as Items.json.txt since it was just previously Items.json? (Probably a stupid question but I just want to make sure)
You can name your files whatever you want. I just explained that there is no difference between .json and .txt.
Sorry, but just one very last thing. I'm recieving an error that says this: $$anonymous$$eyNotFoundException: The given key was not present in the dictionary. I googled it and got quite a few results but found no solution. Any ideas?
Your answer
![](https://koobas.hobune.stream/wayback/20220612060905im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Copy and Pasted code for Trajectory and got one parsing error... 1 Answer
Editor is Broken 1 Answer
Class Inheritance Issue. 0 Answers
How to fix CS0246 error 1 Answer