Monday, March 25, 2019

The controller for path '/' was not found or does not implement IController.

In this post I am gonna share an issue which I faced. Probably most of the sitecore beginners would have gone through this.

     The controller for path '/' was not found or does not implement IController.

While working on my sitecore application everything was fine before implementing the controller rendering.As you know, we need to register the controller name and action in the rendering's definition item. 

I created a controller rendering to show breadcrumb in my webpage with Breadcrumb as the name and Index as the action method. I made this rendering to appear on the pageHeader placeholder.
But when I previewed the page, I was surprised to see the following screen. 



From the error message I got to know that the controller is not recognized by sitecore. Later I found that, I have not provided the proper name in the definition item of my controller rendering.Yes, it's a typo issue.


It was supposed to be Breadcrumb and not Breadcrum. That's it correcting that solved my issue.

Possibilities of this issue: 
  • typo error in Controller or Action field.
  • Controller may not exists in the path specified.
  • File may not be published.    

Hope this will help someone.
Thanks for reading.. Let's TRAVEL WITH SITECORE...

Saturday, March 23, 2019

CREATING A VISUAL STUDIO SOLUTION FOR SITECORE PROJECT



Here are the steps that help sitecore beginners on how to create a visual studio solution for their sitecore project.

1. Open Visual Studio as Administrator

2. Choose File -> New Project

3. In the dialog box, select ASP.NET Web Application

4. Select Empty template and check the MVC checkbox in Add Folders and core references section and click OK

5. Once the VS project is created, replace the global.asax file of newly created project with the global.asax file from the Website folder of sitecore instance.It will have only %@Application Language='C#' Inherits="Sitecore.Web.Application" %

6. Similarly replace the Web.config of VS solution with the Web.config file of the sitecore instance. This is done because once if we publish the project,the file in the project should not overwrite those within the sitecore instance.

7. Right-Click the References in VS solution, select Add Reference-and browse to the bin folder within website folder of sitecore instance. Select the following files:
Sitecore.Kernel
Sitecore.Mvc
Sitecore.Mvc.Analytics

8. For each of the above added references , right-click it and go to Properties.In that, set the Copy Local property to false

9. In VS project,go to Views/web.config file and add the following namespaces:
<add namespace="Sitecore.Mvc" />
<add namespace="Sitecore.Mvc.Presentation" />

10. Now, right-click near the toolbar of VS project and check the Web One Click Publish. In the Create Publish Setting dropdown, select <New Custom Profile> In the dialog box appeared choose File system. In the dropdown of target location, browse to the website folder of sitecore instance. Then click Publish.
Now MVC solution is created for the sitecore instance.

Thanks for reading.. Let's TRAVEL WITH SITECORE...

Friday, March 15, 2019

Solr service stopped running


As all know, working with sitecore is amazing. But still we would have gone through so many issues while setting up the sitecore solution. In this blog,I am going to share a common issue which most of the sitecore beginners have faced along with the solution.

When I installed sitecore 9.0 for the first time it requires solr to be configured and all other stuffs for my site. It was working very fine and one day, when I was about to rebuild my indexes I was surprised to see my Indexing Manager as blank as below


   
But how this would have happened ? Then I understood that the problem might be with the solr. I checked with the solr url, https://localhost:8983/solr/# and found that it was running.

Then I checked with the services and there my solr service was in Paused state.




While attempting to restart the service, I got the pop up saying that, Windows could not start the solr-6.6.2 service on Local Computer.




There are so many reasons for this solr issue.But to identify the actual cause, try to start the service using command prompt.




Now I figured out that the problem is with the JAVA_HOME system variable. I checked the value for that variable and it said C:\Program Files\Java\jre1.8.0_171, but the actual path is C:\Program Files\Java\jre1.8.0_201.





Thats it, now just updating the correct path of JAVA_HOME environment variable solved this issue.It is recommended that the variable should point to the path where the java has been installed on the system. Now restarting the solr service and it started running and all my indexes are back !!





Thanks for reading and let's TRAVEL WITH SITECORE …