代码之家  ›  专栏  ›  技术社区  ›  Martin McMahon

连接到Azure数据库

  •  0
  • Martin McMahon  · 技术社区  · 10 年前

    我有一个使用SQLCE开发的Umbraco站点,然后我将其更改为SQLEXPRESS,并可以在本地连接到两者。我部署到Azure(最初使用CE),一切正常,然后我创建了一个SQL Azure数据库,并将SQLEXPRESS复制到那里,这似乎也起了作用,我可以使用SQL Management Studio连接到SQL Azure的数据库。

    当我尝试从我的应用程序连接到Azure数据库时出现问题,我已经更新了web。使用Azure连接字符串进行配置,但我在本地和Azure中都得到-

    Value cannot be null.
    Parameter name: sqlSyntax 
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
     Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: sqlSyntax
    
    Source Error: 
    
    
     An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Stack Trace: 
    
    
    
    [ArgumentNullException: Value cannot be null.
    Parameter name: sqlSyntax]
       Umbraco.Core.Persistence.Repositories.PetaPocoRepositoryBase`2..ctor(IDatabaseUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax) +120
       Umbraco.Core.Persistence.Repositories.DomainRepository..ctor(IDatabaseUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax) +23
       Umbraco.Core.Services.DomainService.GetAll(Boolean includeWildcards) +75
       Umbraco.Web.Routing.PublishedContentRequestEngine.FindDomain() +286
       Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +15
       Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +361
       Umbraco.Web.UmbracoModule.<Init>b__8(Object sender, EventArgs e) +80
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
    

    你知道哪里出了问题吗?

    2 回复  |  直到 9 年前
        1
  •  2
  •   Pieter    10 年前

    此错误发生在。config包含空的umbracoDbDSN键,但umbracoConfigurationStatus键已填充。即。:

    <appSettings>
      <add key="umbracoConfigurationStatus" value="7.3.4" />
      ...
    </appSettings>
    <connectionStrings>
      <add name="umbracoDbDSN" connectionString="" providerName="" />
      ...
    </connectionStrings>
    

    双击umbracoDbDSN connectionString和providerName。您可以通过清空web.config中umbracoConfigurationStatus的值,尝试在SQL Azure数据库中重新安装Umbraco。

    代替

    <add key="umbracoConfigurationStatus" value="7.3.4" />
    

    具有

    <add key="umbracoConfigurationStatus" value="" />
    
        2
  •  0
  •   Matias Quaranta    10 年前

    我不熟悉乌姆布拉科,但你有没有遵循 migration guide to Azure SQL 他们的网站上有吗?

    This post MSDN上也引用了Azure Umbraco Acceletator .

    作为补充说明,他们还有一个 Umbraco-as-a-Service 在Azure上运行的产品。