asp.net mvc 4 - How to add a json file as content to a MVC 4 Web Application -


i have json file include content mvc 4 web application. add file content folder , mark 'build action' 'content' , 'copy output directory' 'do not copy'. if browse http://[my site]/content/myjsonfile.json http 404. mess around of build actions , copy output selections , still doesn't work. change json file extension txt , works. bug? site published using windows azure. feedback.

the problem webserver doesn't recognize filetype. add line web.config:

<system.webserver>     <staticcontent>       <mimemap fileextension=".json" mimetype="application/json; charset=utf-8" />      </staticcontent> </system.webserver> 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -