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

Iis 无法在本地运行Kentico解决方案,iis,configuration,kentico,Iis,Configuration,Kentico,形势: 我在一个网站上工作,该网站最近从Kentico 8.2更新为Kentico 9,然后从Kentico 9更新为Kentico 10。根据升级日志,所有升级都是成功的,但是,Kentico SmartSearch在出现升级错误:“加载“SearchBox”类型的Web部件“SearchBox”时出错”后不再正常工作 目标: 我的目标是在我的本地机器上创建一个实时网站的开发副本,这样我就可以解决问题并在本地进行测试,我不确定如何实现这一点 问题: 我已要求从live网站获得文件夹、解决方案和

形势: 我在一个网站上工作,该网站最近从Kentico 8.2更新为Kentico 9,然后从Kentico 9更新为Kentico 10。根据升级日志,所有升级都是成功的,但是,Kentico SmartSearch在出现升级错误:“加载“SearchBox”类型的Web部件“SearchBox”时出错”后不再正常工作

目标: 我的目标是在我的本地机器上创建一个实时网站的开发副本,这样我就可以解决问题并在本地进行测试,我不确定如何实现这一点

问题: 我已要求从live网站获得文件夹、解决方案和数据库的精确克隆,我已将数据库导入我的sql server,之后我在Visual Studio 2017 Community Edition上打开了解决方案,更新了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
 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:
检查IIS日志后

我检查了IIS事件日志,当我尝试运行website 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-警告(与原始例外情况相同):


如果无法运行管理,则可能需要检查表CMS\U LicenseKey中是否有localhost,如果没有,请在表中创建一条与生产数据相同的新记录,并将licensedomain更改为localhost。可能会涉及另一张表,但我不确定?

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

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

解决方案: 在与Kentico支持部门交换了一些电子邮件后,我被建议从SSL缩回,以使网站在http://(即使CMS设置强制使用https)上运行。因此,我编辑了web.config文件:

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

并已更改IIS设置以允许http

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

  • 在站点应用程序中将域更改为localhost
  • 更改“站点”应用程序中的默认区域性
  • 将母版页复制并发布到正确的区域性中
现在这个网站正在正常运行,我仍然对一些样式表有一些问题,但我相信这些与这个问题无关


我要感谢每一位试图帮助我的人,特别是肯迪科公司的支持,他们当时在场

您如何在IIS中设置站点?指向/CMS文件夹的本地主机站点?是否在IIS中为身份验证设置启用了表单身份验证?在web.config中添加了URL重写吗?Hi@Rui,谢谢你的回复,我已经设置了一个指向/CMS文件夹的本地主机站点,IIS中启用了表单和匿名身份验证,并且在web.config中没有添加URL重写规则。你能创建一个静态的.ASPX页面(例如test.ASPX)吗在CMS文件夹中,查看是否可以加载?@Rui我无法加载,我得到“无效网站”,并显示以下消息:网站已停止,或者未为任何网站配置请求的域名:如果您是此网站的管理员,您需要转到站点并确保在站点属性或正在运行的网站的域别名中配置了以下域名:localhost是否为本地IIS启用了.net framework?感谢您的回复,事实上,在我的CMS\U LicenseKey表中有一个localhost行,我已将LicenseKey替换为生产域中的密钥,并将“域:”部分更改为localhost,但问题仍然存在,例外情况似乎总是一样的。我不认为有任何其他表涉及或至少与之相关,我可以看到。