Guillermo Oramas R.
Guillermo Oramas R.

Reputation: 1303

Error accessing Web.config AppHarbor deployment

I have a c# MVC 3 project deployed in AppHarbor, the thing is that I need to change the connection string that AppHarbor uses, in order to add MultipleActiveResults = True. For it in the Application_Start() on the Global.asax.cs file I add this:

var configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
var connectionString = configuration.ConnectionStrings.ConnectionStrings["SumDb"].ConnectionString;
if (!connectionString.Contains("MultipleActiveResultSets=True;"))
{
    connectionString += "MultipleActiveResultSets=True;";
}
configuration.ConnectionStrings.ConnectionStrings["SumDb"].ConnectionString = connectionString;
configuration.Save();

But for some reason, when I access my project trough AppHarbor I'm getting this access error to the file:

An error occurred loading a configuration file: Access to the path 'D:\websites\4c\cb534\0x00 (...) uymh.tmp' is denied.

Maybe I need some permission or something like that. Plz Help.

Upvotes: 1

Views: 313

Answers (1)

friism
friism

Reputation: 19279

You will have to enable write access to your AppHarbor worker filesystem in Application settings. It's read-only (except for App_Data) by default.

Upvotes: 1

Related Questions