Error in plugins : The view at ... must derive from WebViewPage, or WebViewPage<TModel>.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Hi, I'm creating a plugin, I'm adding a tab to the category page, but I have this error when loading a test controller:

The view at '~/Plugins/Misc.Ebay4Two/Views/test.cshtml' must derive from WebViewPage, or WebViewPage<TModel>.



This is my view
@using Nop.Web.Framework;
@using Nop.Web.Framework.UI;
@model Nop.Plugin.Misc.Ebay4Two.Domain.EbayCategory

@{
    Layout = "_AdminLayout.cshtml";
}

test test


This is my CustomViewEngine
public class CustomViewEngine : ThemeableRazorViewEngine
    {
        public CustomViewEngine()
        {
            ViewLocationFormats = new[] { "~/Plugins/Misc.Ebay4Two/Views/{0}.cshtml" };
            PartialViewLocationFormats = new[] { "~/Plugins/Misc.Ebay4Two/Views/{0}.cshtml" };
        }
    }


This is my routeconfig.cs
public class RouteConfig :IRouteProvider
    {
        public int Priority
        {
            get {return 1;}
        }
        public void RegisterRoutes(RouteCollection routes)
        {

            ViewEngines.Engines.Insert(0, new CustomViewEngine());
        }
    }


What Am I missing?
Thank you very much.
9 years ago
I think the error would be regarding the version of Mvc dll that you are using and the one you were referencing in your web.config file.Please check your dll version of mvc and the one you referenced in your Web.config file.

Simple Way to resolve this error is to copy Existing web.config file from the other Nop commerce plugin project in to your plugin Project.

I hope this Helps
7 years ago
maria.pithia wrote:
I think the error would be regarding the version of Mvc dll that you are using and the one you were referencing in your web.config file.Please check your dll version of mvc and the one you referenced in your Web.config file.

Simple Way to resolve this error is to copy Existing web.config file from the other Nop commerce plugin project in to your plugin Project.

I hope this Helps


I have been facing the same problem for a while and could not understand the cause exactly. I tried several ways including what you have suggested. No Luck.

I wonder nobody else faces such problem.
7 years ago
vkotecha91 wrote:
I think the error would be regarding the version of Mvc dll that you are using and the one you were referencing in your web.config file.Please check your dll version of mvc and the one you referenced in your Web.config file.

Simple Way to resolve this error is to copy Existing web.config file from the other Nop commerce plugin project in to your plugin Project.

I hope this Helps

I have been facing the same problem for a while and could not understand the cause exactly. I tried several ways including what you have suggested. No Luck.

I wonder nobody else faces such problem.


I faced the same issue. I was able to solve it by copying then pasting the web.config file contents of another plugin
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.