I added some JSON files to my project (under Assets/Resources), and when I generate a visual studio solution, it doesn’t add those files.
If I rename them to .txt, then it does, but then the syntax highlight doesn’t work well.
If I add them manually from within Visual Studio, then after a while Unity will overwrite the project files and they are removed from the solution once again.
This is a bit frustrating. How can I get Unity to add JSON files to the Visual Studio solution?
Here is a gist I just wrote to add JSON files to the generated Visual Studio project! Just drop it into Unity somewhere and force Unity to regenerate the VS project (clicking on .cs file should do the trick).
This will add JSON files that are anywhere under Assets. Note that it adds them to the “Assembly-CSharp” project, even if the JSON is under an Editor directory.