The name 'T' does not exist in the current context while overriding view in a nopCommerce plugin

997 views Asked by At

First, for context, I'm working on a Plugin for nopCommerce.

I am overriding a view (namely \Presentation\Nop.Web\Administration\Views\Currency\List.cshtml) in my plugin by creating a custom view engine. Now though that's successful, I'm having trouble loading my customized view.

One of probably several errors when app tries to load my view:

enter image description here

Apparently not very experienced with front-end so subsequently with how views work.

Edit: Created View doesn't recognize sln project references to better localize the issue.

1

There are 1 answers

6
Raju Paladiya On

From the error message, it seems that the namespace reference is missing for the localization.

To resolve this error, you need to add a reference @using Nop.Web.Framework.Mvc.Razor in your overridden view page.

Another way is to add the reference to _ViewImports.cshtml file under your plugin > views folder.

A better way is to copy _ViewImports.cshtml file from \Presentation\Nop.Web\Areas\Admin\Views\_ViewImports.cshtml and paste it to your plugin > Views Folder

This will resolve the error you're facing.