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
Post a Comment