对象引用未设置为启动时调用GetDomains对象的实例

时间:2014-06-10 15:19:22

标签: asp.net sql content-management-system umbraco umbraco6

*注意:这不是空引用重复问题。造成这种情况的原因并不是那么明显,需要进行更深入的调查。

我的网站在我的本地开发盒上工作正常,然后我决定将Umbraco 6从使用嵌入式数据库(SDF)转换为完整的SQL数据库(MDF)。使用WebMatrix进行数据库转换很顺利,但现在在更改Web配置以使用完整SQL后,网站在运行时会收到以下错误。我已经在线阅读了一些帮助文章,但似乎没有解决我的问题。有任何想法吗? (SQL权限,缓存可能,我错过了配置设置吗?

我基本上这样做http://carlosmartinezt.com/2014/03/umbraco-migrate-from-sql-ce-to-sql-server/

这是我的web.config

    <system.data>
    <DbProviderFactories>
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
    </DbProviderFactories>
  </system.data>
  <system.net>
    <mailSettings>
      <smtp>
        <network host="127.0.0.1" userName="username" password="password" />
      </smtp>
    </mailSettings>
  </system.net>
  <connectionStrings>
    <add connectionString="Data Source=KBURMARK;Initial Catalog=Umbraco;Integrated Security=True" name="Umbraco" providerName="System.Data.SqlClient" />
    <!-- Important: If you're upgrading Umbraco, do not clear the connection string / provider name during your web.config merge. -->
  </connectionStrings>

这是我得到的错误

[NullReferenceException: Object reference not set to an instance of an object.]
   umbraco.cms.businesslogic.web.Domain.<GetDomains>b__0() +122
   Umbraco.Core.Cache.<>c__DisplayClass1`1.<GetCacheItem>b__0() +41
   Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency) +246
   Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) +159
   Umbraco.Core.Cache.CacheProviderExtensions.GetCacheItem(IRuntimeCacheProvider provider, String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) +219
   Umbraco.Core.CacheHelper.GetCacheItem(String cacheKey, TimeSpan timeout, Func`1 getCacheItem) +339
   umbraco.cms.businesslogic.web.Domain.GetDomains(Boolean includeWildcards) +243
   Umbraco.Web.Routing.DomainHelper.GetAllDomains(Boolean includeWildcards) +40
   Umbraco.Web.Routing.PublishedContentRequestEngine.FindDomain() +365
   Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +59
   Umbraco.Web.Routing.PublishedContentRequest.Prepare() +36
   Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +738
   Umbraco.Web.UmbracoModule.<Init>b__7(Object sender, EventArgs e) +132
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

1 个答案:

答案 0 :(得分:1)

我以同样的方式解决了这个问题。设置连接字符串name =“umbracoDbDSN”