Ruhith Udakara
Ruhith Udakara

Reputation: 2452

Could not load type 'NewSite.MvcApplication' kentico

i'm pretty new to this.i newly installed kentico cms and it hosted in IIS server whenever i try to access the localhost website i get this error.enter image description here

this is my Global.asax.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

using Kentico.Web.Mvc;

namespace NewSite
{
    public partial class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            // Enables and configures selected Kentico ASP.NET MVC integration features
            ApplicationConfig.RegisterFeatures(ApplicationBuilder.Current);

            // Registers routes including system routes for enabled features
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            // Registers enabled bundles
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }
}

this is my Global.asax

<%@ Application Codebehind="Global.asax.cs" Inherits="NewSite.MvcApplication" Language="C#" %>

what did i missed here,any help please.i'm stuck here in hours now

Upvotes: 0

Views: 527

Answers (1)

Ruhith Udakara
Ruhith Udakara

Reputation: 2452

finally i found a solution and i don't know this is the best way to fix this because i'm new to this.

i changed

Codebehind="Global.asax.cs"

to

CodeFile="Global.asax.cs"

in Global.asax file

and it's working.

please let me know if this is a not good solution.

Upvotes: 1

Related Questions