1

I am new to Kentico and going through the Kentico 12 MVC Training Course using the MedioClinic sample project. On running the MVC project for live site I am getting the below error. Could someone please help me with this.

Server Error in '/Kentico12_MedioClinic' Application. Page type with 'MedioClinic.HomeSection' class name not found.

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: CMS.DocumentEngine.DocumentTypeNotExistsException: Page type with 'MedioClinic.HomeSection' class name not found.

Source Error: Line 38: { Line 39: var query = DocumentHelper.GetDocuments(); Line 40: Line 41: // Loads the latest version of documents as preview mode is enabled Line 42: if (SiteContext.IsPreviewEnabled)

Source File: C:\Users\A0808038\Desktop\Kentico\training-kentico-k12-master\training-kentico-k12-master\Business\Services\Query\DocumentQueryService.cs Line: 40

Thanks in Advance

  • Have you created the page type? What is the code name of your page type and have you copied the generated classes from the admin app over to the MVC app? – jurajo Jan 11 '21 at 05:35

1 Answers1

0

From the admin area go to edit the page type "MedioClinic.HomeSection" and click on the vertical tab "Code" then from there click on generate code, so those are saved physically on the /CMS/Old_App_code folder from the WebApp solution.

Copy that generated file to your MVC project, add the correct using to your class and that should fix the issue.

vhugo
  • 543
  • 1
  • 5
  • 23