【问题标题】:Azure: {"Invalid syntax for directory path ''\r\nParameter name: initialConfiguration"} ErrorAzure:{“目录路径 '' 的语法无效\r\n参数名称:initialConfiguration”} 错误
【发布时间】:2013-09-12 16:54:03
【问题描述】:

我正在尝试将我的日志文件添加到 Blob 存储。当试图在 Global.asax.cs 中获取 ConnectionString 时,我从 orient here 收到此错误:

DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnostics);

我该如何解决这个问题。 “Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString”在 ServiceConfiguration.Cloud.cscfg 和 ServiceConfiguration.Local.cscfg 中

给出更多解释:

System.ArgumentOutOfRangeException was unhandled
  HResult=-2146233086
  Message=Invalid syntax for directory path ''
Parameter name: initialConfiguration
  Source=Microsoft.WindowsAzure.Diagnostics
  ParamName=initialConfiguration
  StackTrace:
       at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration.Validate(String paramName, Nullable`1 resourceSize)
       at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.StartWithExplicitConfiguration(DiagnosticMonitorStartupInfo startupInfo, DiagnosticMonitorConfiguration initialConfiguration)
       at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.Start(CloudStorageAccount storageAccount, DiagnosticMonitorConfiguration initialConfiguration)
       at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.Start(String diagnosticsStorageAccountConfigurationSettingName, DiagnosticMonitorConfiguration initialConfiguration)
       at Project.Web.WebRole.OnStart() in Global.asax.cs:line 104
       at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
       at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRole(RoleType roleType)
       at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

【问题讨论】:

    标签: c# asp.net-mvc asp.net-mvc-4 azure azure-blob-storage


    【解决方案1】:

    您正在正确检索连接字符串,但您的诊断配置无效。您为目录配置设置了什么?

    我建议不要通过代码设置诊断配置,而是使用 wadcfg 文件 (http://msdn.microsoft.com/en-us/library/windowsazure/hh411551.aspx),或使用 Visual Studio(请参阅 http://weblogs.asp.net/scottgu/archive/2013/04/30/announcing-the-release-of-windows-azure-sdk-2-0-for-net.aspx,尤其是“云服务:改进的诊断支持”部分)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-04
      • 1970-01-01
      • 1970-01-01
      • 2014-03-17
      • 2014-05-21
      • 1970-01-01
      • 1970-01-01
      • 2021-08-29
      相关资源
      最近更新 更多