无法在本地运行Kentico解决方案

时间:2018-06-13 13:46:24

标签: iis configuration kentico

情况: 我正在开发一个最近从Kentico 8.2更新到Kentico 9,然后从Kentico 9更新到Kentico 10的网站。根据升级日志,所有升级都成功,但是,升级后Kentico SmartSearch不再起作用错误: "加载WebPart' SearchBox'时出错类型' SearchBox'"。

目标: 我的目标是在我的本地机器上创建实时网站的开发副本,以便我可以解决问题并在本地测试它,我不确定如何实现它。

问题: 我已经要求从实时网站上精确克隆文件夹,解决方案和数据库,我已将数据库导入我的sql server,之后我在Visual Studio 2017社区版上打开了解决方案,更新了CMSConnectionString匹配新的数据库路径,我试图构建解决方案,我通过更新引用名称,删除过时的名称修复了一些错误,此时解决方案构建没有错误,但是我无法让它在我的本地机器上运行,每当我尝试在本地机器上运行它时,我有以下例外:

 Object reference not set to an instance of an object.
 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.NullReferenceException: Object reference not set 
 to an instance of an object.

 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: 


 [NullReferenceException: Object reference not set to an instance of an 
 object.]
 CMS.URLRewritingEngine.URLRewriter.RewriteUrl(String relativePath, 
 ExcludedSystemEnum excludedEnum, SiteNameOnDemand siteName, 
 ViewModeOnDemand viewMode) +2387
 CMS.URLRewritingEngine.URLRewriter.RewriteUrl(RequestStatusEnum status, 
 String relativePath, ExcludedSystemEnum excludedEnum) +61
 CMS.URLRewritingEngine.URLRewritingHandlers.RewriteUrl(Object sender, 
 EventArgs e) +50
 CMS.Base.AbstractHandler.CallEventHandler(EventHandler'1 h, TArgs e) +100
 CMS.Base.AbstractHandler.Raise(String partName, List'1 list, TArgs e, 
 Boolean important) +714
 CMS.Base.SimpleHandler'2.RaiseExecute(TArgs e) +100
 CMS.Base.SimpleHandler'2.RaiseExecute(TArgs e) +143
 CMS.Base.SimpleHandler'2.StartEvent(TArgs e) +217
 CMS.Base.ApplicationModule.PostResolveRequestCache(Object sender, EventArgs 
 e) +16
 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep 
.Execute() +201
  System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +132
 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& 
completedSynchronously) +73

检查IIS LOGS后

我检查了IIS事件日志,当我尝试运行网站2事件发生时,我认为这是由于我的一些配置错误但我无法弄清楚缺少什么,所以这里有以下项目事件查看器

1 - 信息:

 Event code: 4005 
 Event message: Forms authentication failed for the request. Reason: The ticket supplied was invalid. 
 Event time: 6/8/2018 11:13:12 AM 
 Event time (UTC): 6/8/2018 10:13:12 AM 
 Event ID: 75f3f8236cca48e0b7d9156a7f648fc1 
 Event sequence: 2 
 Event occurrence: 1 
 Event detail code: 50201 

Application information: 
  Application domain: /LM/W3SVC/1/ROOT/Kentico10-1-131729263846745120 
  Trust level: Full 
  Application Virtual Path: /Kentico10 
  Application Path: C:\inetpub\wwwroot\Kentico10\CMS\ 
  Machine name: FAKENAME
Process information: 
  Process ID: 1392 
  Process name: w3wp.exe 
  Account name: FAKEDOMAIN\Jony.Bimbinz 

Request information: 
  Request URL: http://localhost/Kentico10 
  Request path: /Kentico10 
  User host address: ::1 
  User:  
  Is authenticated: False 
  Authentication Type:  
  Thread account name: FAKEDOMAIN\Jony.Bimbinz 

Name to authenticate:  

Custom event details: 

2 - 警告(与原始例外相同):

 Event code: 3005     
 Event message: An unhandled exception has occurred.     
 Event time: 6/8/2018 11:54:58 AM     
 Event time (UTC): 6/8/2018 10:54:58 AM     
 Event ID: b16d590261134c3c9b988bdb01a24b73    
 Event sequence: 4     
 Event occurrence: 1     
 Event detail code: 0

Application information: 
    Application domain: /LM/W3SVC/1/ROOT/Kentico10-1-131729288917669454 
    Trust level: Full 
    Application Virtual Path: /Kentico10 
    Application Path: C:\inetpub\wwwroot\Kentico10\CMS\ 
    Machine name: FAKENAME 

Process information: 
    Process ID: 9336 
    Process name: w3wp.exe 
    Account name: FAKEDOMAIN\Jony.Bimbinz

Exception information: 
    Exception type: NullReferenceException 
    Exception message: Object reference not set to an instance of an object.
   at CMS.URLRewritingEngine.URLRewriter.RewriteUrl(String relativePath, ExcludedSystemEnum excludedEnum, SiteNameOnDemand siteName, ViewModeOnDemand viewMode)
   at CMS.URLRewritingEngine.URLRewriter.RewriteUrl(RequestStatusEnum status, String relativePath, ExcludedSystemEnum excludedEnum)
   at CMS.URLRewritingEngine.URLRewritingHandlers.RewriteUrl(Object sender, EventArgs e)
   at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler'1 h, TArgs e)
   at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List'1 list, TArgs e, Boolean important)
   at CMS.Base.SimpleHandler'2.RaiseExecute(TArgs e)
   at CMS.Base.SimpleHandler'2.RaiseExecute(TArgs e)
   at CMS.Base.SimpleHandler'2.StartEvent(TArgs e)
   at CMS.Base.ApplicationModule.PostResolveRequestCache(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



  Request information: 
    Request URL: http://localhost/Kentico10 
    Request path: /Kentico10 
    User host address: ::1 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: FAKEDOMAIN\Joao.Ferreira 

Thread information: 
    Thread ID: 10 
    Thread account name: FAKEDOMAIN\Jony.Bimbinz
    Is impersonating: False 
    Stack trace:    at CMS.URLRewritingEngine.URLRewriter.RewriteUrl(String relativePath, ExcludedSystemEnum excludedEnum, SiteNameOnDemand siteName, ViewModeOnDemand viewMode)
   at CMS.URLRewritingEngine.URLRewriter.RewriteUrl(RequestStatusEnum status, String relativePath, ExcludedSystemEnum excludedEnum)
   at CMS.URLRewritingEngine.URLRewritingHandlers.RewriteUrl(Object sender, EventArgs e)
   at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler'1 h, TArgs e)
   at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List'1 list, TArgs e, Boolean important)
   at CMS.Base.SimpleHandler'2.RaiseExecute(TArgs e)
   at CMS.Base.SimpleHandler'2.RaiseExecute(TArgs e)
   at CMS.Base.SimpleHandler'2.StartEvent(TArgs e)
   at CMS.Base.ApplicationModule.PostResolveRequestCache(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Custom event details:

2 个答案:

答案 0 :(得分:1)

主要问题 主要问题是由于“网站”应用程序中的区域性设置不正确,默认区域性的母版页也丢失了,因此当单击默认路径“ /”时,将引发异常。

“请求的表单身份验证失败。原因:提供的票证无效。”异常,我能够通过在IIS中生成新的machineKey并使用它编辑web.config文件来解决此问题。

解决方案: 在与Kentico支持人员交换了一些电子邮件之后,建议我从SSL缩减以使站点在http://上运行(即使CMS设置强制使用https),所以我做到了,我编辑了web.config文件:< / p>

<httpCookies httpOnlyCookies="true" requireSSL="false" />

并已更改IIS设置以允许使用http。

从那时起,我终于能够登录到“管理”页面,该页面不再引发无效的网站错误,并且能够:

  • 在“站点”应用程序中将域更改为localhost。
  • 在“网站”应用程序中更改默认区域性。
  • 将母版页复制并发布到正确的区域。

现在该网站正在按预期运行,我在某些样式表上仍然存在一些问题,但我相信这些问题与该问题无关。

我要感谢所有尝试提供帮助的人,特别是对当场的Kentico支持人员!

答案 1 :(得分:0)

如果无法运行管理员,则可能需要检查CMS_LicenseKey表中是否存在localhost,如果不在表中,则在该表中创建一个与Production数据相同的新记录,然后将licensedomain更改为localhost。可能还会有另一个表,但我不确定吗?

相关问题