Issues while building kentico solution

Joao Ferreira asked on June 7, 2018 13:07

Hi there,

I am working on a website that has been recently updated from 8.2 to 9 and then from 9 to 10. According to the upgrade logs, all upgrades were successful, however, the Kentico SmartSearch is no longer functional following the upgrades Error: "Error loading the WebPart 'SearchBox' of type 'SearchBox'".

My objective is to create a development copy of the live website in my local machine and I am unsure on how to accomplish that.

I have asked for an exact clone of the folder, solution and Database from the live website, I've imported the database to my sql server and after that I've opened the solution on Visual Studio 2017 Community Edition, updated the CMSConnectionString to match the new db path and I've tried to build the solution, there were some errors that I've fixed by updating the references names, removing the obsolete ones and at this point the Solution Builds without errors, however I am unable to make it run on my local Machine, whenever I try to run it in my local machine I have the following exception:

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

My question is: What am I missing to successfully run this solution in my local machine?

I kindly thank you guys in advance for reading and possibly replying to this.

Recent Answers


Brenden Kehren answered on June 7, 2018 14:58

Regarding the Smart Search, I'd check to see if it's using a custom layout or not. If so, make sure it has the full path/namespace to the actual file in that custom layout. If it is using the default layout then you will need to debug the site a bit more to get more info from that. The event log should have more information on that.

Regarding your second error, you might want to look into the IIS event logs a bit more as they can have more details to your problem. Another solution would be to debug it locally and see where it breaks. May give you some insites as to where to start looking. If your upgrades worked without error then it could be custom code causing the problem.

0 votesVote for this answer Mark as a Correct answer

Joao Ferreira answered on June 8, 2018 13:00

Good Morning Brenden and thank you for your reply.

I've looked into the IIS event logs and I've found 2 items, I think this is due to some configuration error on my behalf but I cant quite figure out what is missing so here are the following items on the event viewer:

1 - Information:

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\Joao.Ferreira 

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 

Name to authenticate:  

Custom event details: 

2 - Warning:

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\Joao.Ferreira 

    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\Joao.Ferreira 
        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:
0 votesVote for this answer Mark as a Correct answer

Joao Ferreira answered on June 13, 2018 15:20

Hi, is there anyone that can help me with this?

Thanks

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 13, 2018 15:27

Have you run the site locally and debugged it? Debug it and find out where the error comes up. This will give you the ultimate way to find the issue.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.