Closed AdiIndoSwiss closed 2 years ago
I just checked your code, it works as expected, no problem. You can also look at an example of overriding a controller in our plugin.
I am facing the issue only with categorycontroller , the other admin controllers works as expected like productcontroller, customercontroller, ordercontroller.
I can provide the code incase required.
Thanks
Aditya
Something was wrong in the view works now. thanks for your prompt response. Aditya
nopCommerce Version: 4.5.1 Works in 4.40.4
Steps to reproduce the problem:
Goal was to overide the categorycontroller methods(Create and edit) to write more logic in these methods in plugin.
I inherted this into my public partial class MyAdminCategoryController : CategoryController public override async Task Create()
{
public override async Task Edit(int id)
{
Added the route endpointRouteBuilder.MapControllerRoute(name: "MyAdminCategoryEdit", pattern: $"/Admin/Category/Edit/{{id:min(0)}}", defaults: new { controller = "MyAdminCategory", action = "Edit", area = "Admin" });
When i go to admin for the creation of category or modify , i don't get any error , just that an access violation is thrown.
Here is the extract from the debug window
'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'hh5fcpa5.mnn'. Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor: Information: Executing ViewResult, running view ~/Plugins/Nop.Plugin.Misc.BookShopConnector/Views/Category/Admin/Create.cshtml. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'ahgdkqkx.qaz'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'C:\Projects\cdi\nopfourpointfivecdi\src\Presentation\Nop.Web\bin\Debug\net6.0\System.Linq.Dynamic.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.2\System.Diagnostics.Tools.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.2\System.Reflection.DispatchProxy.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\6.0.2\Microsoft.AspNetCore.Components.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'wrgkcbre.mtf'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'w5cbtbhd.yjp'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'orfgpayx.mhv'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'ls2nlwko.j2h'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'svp2tdnb.c0i'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'dk3gsqig.gwy'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded '4hqll4oc.i4e'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'ravasr3j.bcv'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'lc0c5gwx.gdk'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'x1zjxi4m.umg'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'uwrfz4ng.luy'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded 'n5rxpf2h.xsa'. 'Nop.Web.exe' (CoreCLR: clrhost): Loaded '5lim24xd.wcr'. The program '[17788] Nop.Web.exe' has exited with code 3221225477 (0xc0000005) 'Access violation'.
Aditya yadav