Total Posts:
13
Karma:
113
Joined:
7/1/2009
Location:
Italy
Hi everybody I'm trying to develop a plugin for nopcommerce 4. I started development by copy and paste existing module and renaming class and folders. But now i have a strungly problem. Inside view i receive for @T("<someresource>") the error "@T doesn't exist in current context" inside other modules this error doesn't occur and i can see derived class public abstract class NopRazorPage<TModel> : Microsoft.AspNetCore.Mvc.Razor.RazorPage<TModel> properly. What is wrong in my scenario ? Another problem is also that debug are not working and break point are unreachable. Thanks in advance
MVP
Gold Solution Partner
Certified Developer
Total Posts:
767
Karma:
10894
Joined:
5/6/2016
Location:
India
Hi Ceaser, Makes sure you have view file "_ViewImports.cshtml" under views folder. If it not exist than copy from "Presentation > Nop.Web > Views" and paste it. It'll work.
Total Posts:
13
Karma:
113
Joined:
7/1/2009
Location:
Italy
Problem solved doing as you said. Thanks very much !
Total Posts:
7
Karma:
35
Joined:
5/28/2018
Location:
India
can somebody tell that, what exactly is @T() what it does
Total Posts:
16
Karma:
80
Joined:
8/15/2013
Location:
Switzerland
Hi , i have the same problem as cesare.marasco in nopcommerce 4.4 in a plugin in Configure.cshtml "@T doesn't exist in current context" the _ViewImports.cshtm is here : @inherits Nop.Web.Framework.Mvc.Razor.NopRazorPage<TModel> @inject Nop.Services.Common.IGenericAttributeService genericAttributeService @inject IWorkContext workContext @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Nop.Web.Framework @using System.Text.Encodings.Web @using Microsoft.AspNetCore.Mvc.ViewFeatures @using Microsoft.AspNetCore.Routing @using Microsoft.Extensions.Primitives @using Nop.Core @using Nop.Core.Domain.Common @using Nop.Core.Infrastructure @using Nop.Services.Events @using Nop.Web.Framework @using Nop.Web.Framework.Models @using Nop.Web.Framework.Events @using Nop.Web.Framework.Extensions @using Nop.Web.Framework.Infrastructure @using Nop.Web.Framework.Models.DataTables @using Nop.Web.Framework.Security.Captcha @using Nop.Web.Framework.Security.Honeypot @using Nop.Web.Framework.Themes @using Nop.Web.Framework.UI any ideas?
Total Posts:
16
Karma:
80
Joined:
8/15/2013
Location:
Switzerland
_ViewImports.cshtml was missing in outputdirectory. Now it works. Thanks very much !