- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近在网站上遇到了问题,堆栈跟踪表明连接字符串为空。这是在我将 connstr 从 web.config 移动到 azure 门户(即从 xml 文件中剪切节点,将其粘贴到门户中)之后,因此 connstr 根本没有引用 Web 配置
在视频博客中,Scott Hanselman 谈到了门户设置会覆盖 web.config 设置,但从未详细说明 key 是否必须存在于已部署的 Web 配置中才能应用 azure 门户值
这在我脑海中引发了一个疑问 - 如果 web.config 中根本没有某个设置(即没有 xml 节点显示 <add key="blah" value="debugblah" />
),那么门户中的设置是否有效?
最佳答案
if a setting isn't in the web.config at all (i.e. there is no xml node saying
<add key="blah" value="debugblah" />
), will the setting in the portal work?
简短的回答是肯定的。为了简单测试它,您可以使用以下代码。
public ActionResult Index()
{
string appSetting1 = ConfigurationManager.AppSettings["setting1"];
string connectionString1 = ConfigurationManager.ConnectionStrings["connectionString1"]?.ConnectionString;
return Content(string.Format("appSetting1:{0},connectionString1:{1}", appSetting1, connectionString1));
}
在Azure门户中添加参数后,我们可以从ConfigurationManager获取应用程序设置和连接字符串。
这是索引页的结果。
appSetting1:setting1Value,connectionString1:connectionString1Value
当我们使用 Entity Framework 的连接字符串时出现异常。 EF 的连接字符串将包含无法在 Azure 门户中设置的providerName 属性。因此,如果我们需要使用providerName设置连接字符串,我们需要在配置文件中配置连接字符串。
<add name="DataContext" connectionString="dummy" providerName="System.Data.EntityClient" />
关于azure - Azure 门户中的连接字符串/设置 - 是 xdt :Transform ="SetAttributes", 还是 xdt :Transform ="Insert" or hybrid?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44842272/
我有一个包含 WCF 设置的配置文件: “add”元素只有一个 baseAddress 属性,所以我不能使用 Match 定位器。一种方法如何像我的示例中那样转换多个元素? 最
我最近在网站上遇到了问题,堆栈跟踪表明连接字符串为空。这是在我将 connstr 从 web.config 移动到 azure 门户(即从 xml 文件中剪切节点,将其粘贴到门户中)之后,因此 con
我在 web.config 中有以下节点: ... core master ... 我想删除整个 具有主内容的子参数节点的节点。我的 xdt 变换节点或多或少看起来像:
我有自己的 Azure 应用服务站点扩展,它的 xdt 转换与另一个第 3 方站点扩展冲突。有没有办法确定 xdt 变换的应用顺序,我可以控制顺序吗? 最佳答案 在您的应用服务中,转到 D:\home
我要转换的配置如下所示: D:\my\old\path\aaa D:\my\old\path\bbb D:\my\old\path\ccc 我只想替换 D:\my\old\path\与
所以我开始玩 nuget,它是 web.config install/uninstall.xdt 值。 我的问题是,是否存在将清除空元素的 xdt:Transform。我在这里没有找到任何东西。 ht
我正在创建一个 nuget 包,其中安装包的部分结果是修改我的 web.release.config。 我可以使用我的 web.release.config.install.xdt 将元素插入此文件,
我正在尝试使用 XDT 转换为我的 NuGet 包创建一个 web.config 安装程序。 我想转换 web.config 文件: 看起来像这样:
其实我对xtd-transform了解不多。我的 xdt 文件中需要什么: 我在 powershell 中做的日常工作: $cache.SetAttribute("key","EndpointNam
我正在尝试使用 Azure 网站设置反向代理,大致如下 this guide这解释了如何在这样的网站上修改 ApplicationHost.config - 但它对我不起作用。 我有这个 applic
我在数据库表中有 XML,需要根据特定条件转换更新值、简单更改。 我做了研究,但只找到了适用于 Web.Config 或 App.Config 的工具/插件: http://ctt.codeplex.
为了转换 html 文件,我开始使用 XDT 转换。一切正常,直到我的 HTML 不符合 xhtml。但我也想转换“普通”HTML5,它不必符合 XHTML。您是否知 Prop 有类似 XDT 转换功
我的 web.config 文件中有一个类似于此结构的自定义部分: 我想对此应用自定义转换,以便我可以使用 Name="foo"更改 Propert
如何更改 Azure Web 应用程序中的 applicationHost.config?我尝试: using (ServerManager serverManager = new ServerMan
我正在尝试更新我的 web.config 中的现有 appSettings。我不想替换整个值,而是将我的新值附加到末尾。这可能吗? 当前值: 必填值: 这是我目前在转换文件中的内容: 最佳答案
我正在尝试将应用程序部署到AppHarbor,并按照他们的有关如何修改web.config的说明进行操作,因此它使用他们的实例auf Sql服务器。 运行解决方案后,我得到了主题中提到的错误: Unr
将 Slow Cheeath(v. 2.5.10.3)安装到我的解决方案中的两个项目后,我收到以下错误: "The "SlowCheetah.Xdt.TransformXml" task could
我正在尝试对 HTML 文件应用转换。转换可以正确处理 div 和 span,但只要我插入 P 标签,它就会失败。 我正在转换的 HTML 文件是: STREAM Interacti
我现在只想更新 WCF 端点 URL 的一部分。现在我们通过为每个“品种”的所有端点包含不同的配置来做到这一点。这管理起来很繁琐。为此,我想在 web.config 中设置一个转换。 这是两个文件示例
我一直在调查 xdt transforms for visual studio 2010它们看起来非常适合跟踪环境变化,但它只提到将其应用于 web.config。我正在处理一个 sitecore 项
我是一名优秀的程序员,十分优秀!