简体   繁体   English

访问Web.config AppHarbor部署时出错

[英]Error accessing Web.config AppHarbor deployment

I have ac# 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 . 我在AppHarbor中部署了一个ac#MVC 3项目,问题是我需要更改AppHarbor使用的连接字符串,以便添加MultipleActiveResults = True For it in the Application_Start() on the Global.asax.cs file I add this: 为此,在Global.asax.cs文件的Application_Start()添加以下代码:

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: 但是由于某种原因,当我通过AppHarbor访问我的项目时,出现了对该文件的访问错误:

An error occurred loading a configuration file: Access to the path 'D:\\websites\\4c\\cb534\\0x00 (...) uymh.tmp' is denied. 加载配置文件时发生错误:拒绝访问路径'D:\\ websites \\ 4c \\ cb534 \\ 0x00(...)uymh.tmp'。

Maybe I need some permission or something like that. 也许我需要一些许可或类似的东西。 Plz Help. 请帮助。

You will have to enable write access to your AppHarbor worker filesystem in Application settings. 您将必须在“应用程序设置”中启用对AppHarbor worker文件系统的写访问权限。 It's read-only (except for App_Data ) by default. 默认情况下,它是只读的( App_Data除外)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM