Hosting ASP.NET MVC web applications on WinHost and using the App_Data folder
Posted: (EET/GMT+2)
Quick note on running ASP.NET MVC web applications in WinHost hosting plans. I regularly use WinHost for small-scale web applications I write with Visual Studio, but almost always, I need to store some data into some form of permanent storage. WinHost hosting plans come with SQL Server access as standard, but for some simple needs, SQL Server can be overkill. In these situations, I often rely on XML files inside the App_Data folder of the application.
Just a quick note, that this works perfectly fine straight out-of-the-box in WinHost plans. With some other ASP.NET providers I've tried (both globally and locally), you must make sure you have proper write rights to this folder before you can start writing or modifying files to that folder.
Personally, if I choose to go the XML file route (instead of a bigger-scale SQL Server database), I'm happily using LINQ-to-XML and XElement objects to read and write my XML files. Works perfectly fine.