if (string.IsNullOrEmpty(parent)) thrownew InvalidOperationException($"The plugin directory for the {_fileProvider.GetFileName(plug)} file exists in a folder outside of the allowed nopCommerce folder hierarchy");
if (!config.UsePluginsShadowCopy) // return RegisterPluginDefinition(config, applicationPartManager, plug); //nop team fix { var assembly = RegisterPluginDefinition(config, applicationPartManager, plug); // delete the .deps file if (plug.EndsWith(".dll")) { _fileProvider.DeleteFile(plug.Substring(0, plug.Length - 4) + ".deps.json"); }
return assembly; } //end nop team fix
//in order to avoid possible issues we still copy libraries into ~/Plugins/bin/ directory if (string.IsNullOrEmpty(shadowCopyPath)) shadowCopyPath = _shadowCopyFolder;
_fileProvider.CreateDirectory(shadowCopyPath); var shadowCopiedPlug = ShadowCopyFile(plug, shadowCopyPath);
Assembly shadowCopiedAssembly = null;
try { shadowCopiedAssembly = RegisterPluginDefinition(config, applicationPartManager, shadowCopiedPlug); } //nop team fix catch (UnauthorizedAccessException) { /*var fileProvider = EngineContext.Current.Resolve<INopFileProvider>(); //suppress exceptions for "locked" assemblies, try load them from another directory if (!config.CopyLockedPluginAssembilesToSubdirectoriesOnStartup || !shadowCopyPath.Equals(fileProvider.MapPath(NopPluginDefaults.ShadowCopyPath))) { throw; }*/ if (!config.CopyLockedPluginAssembilesToSubdirectoriesOnStartup || !shadowCopyPath.Equals(_shadowCopyFolder)) throw; } //end nop team fix catch (FileLoadException) { if (!config.CopyLockedPluginAssembilesToSubdirectoriesOnStartup || !shadowCopyPath.Equals(_shadowCopyFolder)) throw; }
I try to find solution with this Azure problem. I don't want to bother nop team now. I did new release today. http://foxnetsoft.com/content/files/Nop.Core.dll.zip Can you try to check it on your test store with default nopcommerce settings.
Copy back default values and try this DLL.
//Enable if you want to clear /Plugins/bin directory on application startup "ClearPluginShadowDirectoryOnStartup": true, //Enable if you want to copy "locked" assemblies from /Plugins/bin directory to temporary subdirectories on application startup "CopyLockedPluginAssembilesToSubdirectoriesOnStartup": false, //Enable if you want to copy plugins library to the /Plugins/bin directory on application startup "UsePluginsShadowCopy": true, //Enable if you want to load an assembly into the load-from context, by passing some security checks "UseUnsafeLoadAssembly": true,
@Foxnetsoft, isn't the idea to disable plugin shadowcopy? In your appsettings.json note, you have usepluginsshadowcopy set to true. Should this be set to false?
foxnetsoft wrote:
to alldogsoffroad
I try to find solution with this Azure problem. I don't want to bother nop team now. I did new release today. http://foxnetsoft.com/content/files/Nop.Core.dll.zip Can you try to check it on your test store with default nopcommerce settings.
Copy back default values and try this DLL.
//Enable if you want to clear /Plugins/bin directory on application startup "ClearPluginShadowDirectoryOnStartup": true, //Enable if you want to copy "locked" assemblies from /Plugins/bin directory to temporary subdirectories on application startup "CopyLockedPluginAssembilesToSubdirectoriesOnStartup": false, //Enable if you want to copy plugins library to the /Plugins/bin directory on application startup "UsePluginsShadowCopy": true, //Enable if you want to load an assembly into the load-from context, by passing some security checks "UseUnsafeLoadAssembly": true,
I have copied the given Core dll. Made shadowcopy = false
The site stopped working at all. Received error regarding dependent dlls not found. Then I copied respective DLLs to every respective plugin folder for which I as receiving errors. Do you think it was required or am I missing something?
It's important because I still have many many new issues, that's why I thought I should ask, maybe I am going in the wrong direction at all.