Hi, i'm creating a plugin for my site.I went through the nopcommerce guide how to create plugins.when i run the code the following error displays
System.NullReferenceException: Object reference not set to an instance of an object.
private static Assembly PerformFileDeploy(FileInfo plug) Line 326: { Line 327: if (plug.Directory.Parent == null) Line 328: throw new InvalidOperationException("The plugin directory for the " + plug.Name + Line 329: " file exists in a folder outside of the allowed nopCommerce folder heirarchy");
The error is displayed in plugin manager.cs file.The pluginfiles value donot assigned to mainplugin variable for my plugin only. var mainPluginFile = pluginFiles
I put the plugin in the correct path only.that is inside the nop.web/presentation/plugin/.... Can anyone tell me why this error occurs?
Dear Thilak, How to solved this error? I get it too and i can't fix. :( My error msg:
Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 323: private static Assembly PerformFileDeploy(FileInfo plug) Line 324: { Line 325: if (plug.Directory.Parent == null) Line 326: throw new InvalidOperationException("The plugin directory for the " + plug.Name + Line 327: " file exists in a folder outside of the allowed Umbraco folder heirarchy");
[NullReferenceException: Object reference not set to an instance of an object.] Nop.Core.Plugins.PluginManager.PerformFileDeploy(FileInfo plug) in D:\..\Libraries\Nop.Core\Plugins\PluginManager.cs:325 Nop.Core.Plugins.PluginManager.Initialize() in D:\..\Libraries\Nop.Core\Plugins\PluginManager.cs:136
[Exception: Object reference not set to an instance of an object. ] Nop.Core.Plugins.PluginManager.Initialize() in D:\..\Libraries\Nop.Core\Plugins\PluginManager.cs:186
[InvalidOperationException: The pre-application start initialization method Initialize on type Nop.Core.Plugins.PluginManager threw an exception with the following error message: Object reference not set to an instance of an object. .] System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +11567502 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +465 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167
[HttpException (0x80004005): The pre-application start initialization method Initialize on type Nop.Core.Plugins.PluginManager threw an exception with the following error message: Object reference not set to an instance of an object. .] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11556592 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4813333
Hi, Did you just copy the Model,Controller,View from another plugin?if yes means Did you include the Model,Controller,View folder in your project? I just made a fresh plugin in fresh project.
Hi, Did you just copy the Model,Controller,View from another plugin?if yes means Did you include the Model,Controller,View folder in your project? I just made a fresh plugin in fresh project.
Dear Thilak, I just editd view, css and description file in plugin.
Especially the filename. I decided to change the project name after the first plugin compilation and forgot to edit the description.txt. Took me a while to find out why I had this error about the plugin folder being null. Putting the correct DLL filename helped a lot ...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.