Umbraco v6部署到生产服务器,导致数据库异常,内容和媒体树无法加载

时间:2013-03-15 23:36:42

标签: umbraco

我们刚刚将一个新的v6网站部署到一个主机上,该主机上运行了多个v4个网站,没问题。在前端,它看起来很好,但在Umbraco管理员中,内容和媒体树显示为空。

在浏览器调试器中,我可以看到TreeDataService.ashx中存在错误。

错误如下,我不确定问题是什么。是权限吗?数据库用户权限?

----------


You must set the singleton 'Umbraco.Core.Persistence.SqlSyntax.SyntaxConfig' to use an sql syntax provider
Parameter name: SqlSyntaxProvider
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: You must set the singleton 'Umbraco.Core.Persistence.SqlSyntax.SyntaxConfig' to use an sql syntax provider
Parameter name: SqlSyntaxProvider

来源错误:

在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。

堆栈追踪:

[ArgumentNullException: You must set the singleton 'Umbraco.Core.Persistence.SqlSyntax.SyntaxConfig' to use an sql syntax provider
Parameter name: SqlSyntaxProvider]
   Umbraco.Core.Persistence.SqlSyntax.SyntaxConfig.get_SqlSyntaxProvider() +89
   Umbraco.Core.Persistence.Mappers.BaseMapper.GetColumnName(Type dtoType, PropertyInfo dtoProperty) +57
   Umbraco.Core.Persistence.Mappers.ContentMapper.Map(String propertyName) +67
   Umbraco.Core.Persistence.Querying.ModelToSqlExpressionHelper`1.VisitMemberAccess(MemberExpression m) +112
   Umbraco.Core.Persistence.Querying.ModelToSqlExpressionHelper`1.Visit(Expression exp) +101
   Umbraco.Core.Persistence.Querying.ModelToSqlExpressionHelper`1.VisitBinary(BinaryExpression b) +258
   Umbraco.Core.Persistence.Querying.ModelToSqlExpressionHelper`1.Visit(Expression exp) +159
   Umbraco.Core.Persistence.Querying.ModelToSqlExpressionHelper`1.VisitLambda(LambdaExpression lambda) +120
   Umbraco.Core.Persistence.Querying.ModelToSqlExpressionHelper`1.Visit(Expression exp) +72
   Umbraco.Core.Persistence.Querying.Query`1.Where(Expression`1 predicate) +20
   Umbraco.Core.Services.ContentService.GetChildren(Int32 id) +312
   umbraco.cms.businesslogic.web.Document.GetChildrenForTree(Int32 NodeId) +39
   umbraco.cms.presentation.Trees.BaseContentTree.Render(XmlTree& Tree) +27
   umbraco.loadContent.Render(XmlTree& tree) +19
   umbraco.presentation.webservices.TreeDataService.LoadTree(TreeRequestParams treeParams) +79
   umbraco.presentation.webservices.TreeDataService.GetXmlTree() +140
   umbraco.presentation.webservices.TreeDataService.ProcessRequest(HttpContext context) +55
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

3 个答案:

答案 0 :(得分:17)

检查umbraco db连接字符串。

<add name="umbracoDbDSN"....... 

如果包含

  

的providerName =&#34; System.Data.SqlClient的&#34;

然后添加并检查。相同。它可能会开始工作。

答案 1 :(得分:0)

问题是SqlSyntaxProvider为空,我的解决方法是init。

var service = new Umbraco.Core.Services.ContentService();
    SqlSyntaxContext.SqlSyntaxProvider = new MySqlSyntaxProvider();

答案 2 :(得分:0)

连接字符串,add name =“umbracoDbDSN”...缺少以下providerName =“System.Data.SqlClient”

一旦我将其添加到该行,就会开始工作。