Serious IIS Application Pool recycling bug/design flaw

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 anos atrás
AC
4 anos atrás
Hi guys & staff!

Do we have a final fix for that problem? It seems that the 4.10 is totally useless once it was never fixed properly and the fix is in 4.20, that has a lot of changes and cant be downgraded to 4.10. I have a couple of site that even with all fixed proposed here, that crash keeping happening almost every time the application is restarted!
4 anos atrás
Do you yse Azure? Write me in PM.
4 anos atrás
No, I dont! Windows 2012 IIS 8.5.
4 anos atrás
Write me to PM.
Nopcommerce does not have any issues (nop 4.00-4.20).
Nop has some problems with Azure (Azure has another sharping of DLL files).
4 anos atrás
Hi guys-
        We are using Azure for NOP Commerce 4.20. We are seeing some issues with plugins getting Acess Denied exceptions. Can someone please shed some light on what the issues are when using NOP 2.0 and Azure. Thanks!



Application startup exception: System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
---> System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at System.Reflection.Assembly.UnsafeLoadFrom(String assemblyFile)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.AddApplicationParts(ApplicationPartManager applicationPartManager, String assemblyFile, Boolean useUnsafeLoadAssembly) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 160
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, String assemblyFile, String shadowCopyDirectory, NopConfig config, INopFileProvider fileProvider) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 208
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 532
4 anos atrás
zekokhan wrote:
Hi guys-
        We are using Azure for NOP Commerce 4.20. We are seeing some issues with plugins getting Acess Denied exceptions. Can someone please shed some light on what the issues are when using NOP 2.0 and Azure. Thanks!



Application startup exception: System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
---> System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at System.Reflection.Assembly.UnsafeLoadFrom(String assemblyFile)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.AddApplicationParts(ApplicationPartManager applicationPartManager, String assemblyFile, Boolean useUnsafeLoadAssembly) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 160
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, String assemblyFile, String shadowCopyDirectory, NopConfig config, INopFileProvider fileProvider) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 208
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 532


Is there any focus on making nopcommerce actually work on azure web apps as good as on vms? It feels like there are random stuff happening to nopcommerce solutions way to often on web apps.

Is there any performance gain from 4.1 to 4.2 btw?
4 anos atrás
zekokhan wrote:
Hi guys-
        We are using Azure for NOP Commerce 4.20. We are seeing some issues with plugins getting Acess Denied exceptions. Can someone please shed some light on what the issues are when using NOP 2.0 and Azure. Thanks!



Application startup exception: System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
---> System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at System.Reflection.Assembly.UnsafeLoadFrom(String assemblyFile)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.AddApplicationParts(ApplicationPartManager applicationPartManager, String assemblyFile, Boolean useUnsafeLoadAssembly) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 160
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, String assemblyFile, String shadowCopyDirectory, NopConfig config, INopFileProvider fileProvider) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 208
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 532


Check your appsettings.json file. Do they match the following?

//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,
4 anos atrás
hightownhill wrote:
Hi guys-
        We are using Azure for NOP Commerce 4.20. We are seeing some issues with plugins getting Acess Denied exceptions. Can someone please shed some light on what the issues are when using NOP 2.0 and Azure. Thanks!



Application startup exception: System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
---> System.Exception: Plugin 'Work Truck Core Plugin'. Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'D:\home\site\wwwroot\Plugins\bin\WTS.Plugin.WorkTruck.Core.dll'. Access is denied.
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at System.Reflection.Assembly.UnsafeLoadFrom(String assemblyFile)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.AddApplicationParts(ApplicationPartManager applicationPartManager, String assemblyFile, Boolean useUnsafeLoadAssembly) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 160
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, String assemblyFile, String shadowCopyDirectory, NopConfig config, INopFileProvider fileProvider) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 208
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in d:\a\1\s\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 532

Check your appsettings.json file. Do they match the following?

//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,



We actually changed the UsePluginsShadowCopy to false. That resolved the issue. Although, we still see this exception occurring:


crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[11]
      Hosting startup assembly exception
System.InvalidOperationException: Startup assembly DiagnosticServices.HostingStartup failed to execute. See the inner exception for more details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'DiagnosticServices.HostingStartup, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)


We are trying to track down and resolve this issue currently. Will post here if we resolve the situation.

Thanks everyone!
4 anos atrás
zekokhan -
That looks like an issue with Azure hosting environment and not nopCom.
This resource on GitHub maybe of some assistance. Looks like ApplicationInsights site extensions or some other extension could be the culprit.
https://github.com/aspnet/AspNetCore/issues/5919
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.