nopCommerce 4.50 -Suggestions, bug reports and improvements

4 个月 前
Hi, Boyko!

Although using stylesheets outside of the head tag is a bad practice, we understand the reason, so we'll consider your suggestion about new widget zones, but I think for the next release. So far you can use the Tag Helper opt-out character ("!"). It works fine in the admin area.


<!link rel="stylesheet" href="@Url.Content("~/Plugins/{path}.css")" />
4 个月 前
alexey.a wrote:
Hi, Boyko!

Although using stylesheets outside of the head tag is a bad practice, we understand the reason, so we'll consider your suggestion about new widget zones, but I think for the next release. So far you can use the Tag Helper opt-out character ("!"). It works fine in the admin area.


<!link rel="stylesheet" href="@Url.Content("~/Plugins/{path}.css")" />


Thank you for the solution, Alexey!

We will stick to your workaround until you fix it properly in the next releases.

Thanks,
Boyko
4 个月 前
Hello guys,

I just tested upgrading a database from 4.3 to 4.5 directly (using the migrations provided by nopCommerce) but I got the following error:

Unhandled exception. System.AggregateException: One or more errors occurred. (The value '0' is not a valid value for the enum 'ShippingSortingEnum'.)
---> System.ArgumentException: The value '0' is not a valid value for the enum 'ShippingSortingEnum'.
   at System.ComponentModel.EnumConverter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType)
   at System.ComponentModel.TypeConverter.ConvertToString(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.ComponentModel.TypeConverter.ConvertToInvariantString(Object value)
   at Nop.Services.Configuration.SettingService.SetSettingAsync(Type type, String key, Object value, Int32 storeId, Boolean clearCache)
   at Nop.Services.Configuration.SettingService.SaveSettingAsync[T](T settings, Int32 storeId)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Nop.Web.Framework.Migrations.UpgradeTo440.SettingMigration.Up()
   at FluentMigrator.MigrationBase.GetUpExpressions(IMigrationContext context)
   at FluentMigrator.Runner.MigrationRunner.<>c.<ApplyMigrationUp>b__69_0(IMigration m, IMigrationContext c)
   at FluentMigrator.Runner.MigrationRunner.ExecuteMigration(IMigration migration, Action`2 getExpressions)
   at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(IMigrationInfo migrationInfo, Boolean useTransaction)
   at FluentMigrator.Runner.MigrationRunner.Up(IMigration migration)
   at Nop.Data.Migrations.MigrationManager.ApplyUpMigrations(Assembly assembly, MigrationProcessType migrationProcessType)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.StartEngine(IApplicationBuilder application)
   at Program.<Main>$(String[] args)


I think the issue comes from an added property ShippingSorting in the Nop.Core.Domain.Shipping.ShippingSettings which wasn't there in 4.4. The ShippingSettings class is saved by the Nop.Web.Framework.Migrations.UpgradeTo440.SettingMigration but when you upgrade directly from 4.3 to 4.5 the ShippingSorting value doesn't exist in the database so it defaults to 0 which isn't a valid value for the Nop.Core.Domain.Shipping.ShippingSortingEnum and the upgrade fails.
This can be tested easily by creating a sample database in 4.3 and upgrading it directly to 4.5 without running 4.4 code on it.
Most people would upgrade their database directly from 4.3 to 4.5 without running it on 4.4 before that so that would be a big problem for them. I request this to be fixed since this will be a big problem for nopCommerce going forward since version skipping wouldn't work and upgrading your nopCommerce several versions up will be very frustrating having to run your database with the code of each version.

Note: I tested with the NoSource code version of nopCommerce 4.5.

Regards,
Anton
4 个月 前
Hi guys,

I want to report an issue with uploading zip packages, which I found while testing our zip packages.

Steps to reproduce:

1. Install the nopCommerce 4.50 no source code x64 version in IIS with default settings.

2. Download this official Google Shopping plugin for example (or any other for 4.5)

3. Upload the zip file from the administration. Site is restarted and all is good.

4. Upload the zip file again. Site is restarted but could not be started anymore unless you restart the whole website from IIS.

The error in the log is like this:

Unhandled exception. System.Exception: Plugin 'Google Shopping (formely Google Product Search)'. Access to the path 'C:\DEV\nopCommerce\nopCommerce_4.50.0_NoSource_win_x64\Plugins\bin\Nop.Plugin.Feed.GoogleShopping.dll' is denied.
Access to the path 'C:\DEV\nopCommerce\nopCommerce_4.50.0_NoSource_win_x64\Plugins\bin\Nop.Plugin.Feed.GoogleShopping.dll' is denied.


Thanks,
Boyko
4 个月 前
I think I have the same issue.
If two plugins have the same external DLL file (Square.dll) than I can't restart nopcommerce.
I need to remove this DLL file Square.dll from the one plugin folder

Unhandled exception. System.Exception: Plugin 'Square Hosted Checkout'. Access to the path 'C:\Root\nop450\Plugins\bin\Square.dll' is denied.
Access to the path 'C:\Root\nop450\Plugins\bin\Square.dll' is denied.

---> System.Exception: Plugin 'Square Hosted Checkout'. Access to the path 'C:\Root\nop450\Plugins\bin\Square.dll' is denied.
---> System.UnauthorizedAccessException: Access to the path 'C:\Root\nop450\Plugins\bin\Square.dll' is denied.
   at System.IO.FileSystem.DeleteFile(String fullPath)
   at System.IO.File.Delete(String path)
   at Nop.Core.Infrastructure.NopFileProvider.DeleteFile(String filePath)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.ShadowCopyFile(INopFileProvider fileProvider, String assemblyFile, String shadowCopyDirectory)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, String assemblyFile, String shadowCopyDirectory, PluginConfig pluginConfig, INopFileProvider fileProvider)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig)
   --- End of inner exception stack trace ---
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig)
   --- End of inner exception stack trace ---
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, WebApplicationBuilder builder)
3 个月 前
Hi, Boyko. I'm pretty sure this is a shadow copy and IIS pool issue that has been brought up many times and has a built-in solution. You can either turn on the CopyLockedPluginAssembilesToSubdirectoriesOnStartup setting or turn off the setting UsePluginsShadowCopy(both in AppSettings). In both cases, the error should disappear.

Nop-Templates.com wrote:
Hi guys,

I want to report an issue with uploading zip packages, which I found while testing our zip packages.

Steps to reproduce:

1. Install the nopCommerce 4.50 no source code x64 version in IIS with default settings.

2. Download this official Google Shopping plugin for example (or any other for 4.5)

3. Upload the zip file from the administration. Site is restarted and all is good.

4. Upload the zip file again. Site is restarted but could not be started anymore unless you restart the whole website from IIS.

The error in the log is like this:

Unhandled exception. System.Exception: Plugin 'Google Shopping (formely Google Product Search)'. Access to the path 'C:\DEV\nopCommerce\nopCommerce_4.50.0_NoSource_win_x64\Plugins\bin\Nop.Plugin.Feed.GoogleShopping.dll' is denied.
Access to the path 'C:\DEV\nopCommerce\nopCommerce_4.50.0_NoSource_win_x64\Plugins\bin\Nop.Plugin.Feed.GoogleShopping.dll' is denied.


Thanks,
Boyko
3 个月 前
Hi, Anton. I've just created this issue and try to solve it as fast as can

Nop-Templates.com wrote:
Hello guys,

I just tested upgrading a database from 4.3 to 4.5 directly (using the migrations provided by nopCommerce) but I got the following error:

Unhandled exception. System.AggregateException: One or more errors occurred. (The value '0' is not a valid value for the enum 'ShippingSortingEnum'.)
---> System.ArgumentException: The value '0' is not a valid value for the enum 'ShippingSortingEnum'.
   at System.ComponentModel.EnumConverter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType)
   at System.ComponentModel.TypeConverter.ConvertToString(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.ComponentModel.TypeConverter.ConvertToInvariantString(Object value)
   at Nop.Services.Configuration.SettingService.SetSettingAsync(Type type, String key, Object value, Int32 storeId, Boolean clearCache)
   at Nop.Services.Configuration.SettingService.SaveSettingAsync[T](T settings, Int32 storeId)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Nop.Web.Framework.Migrations.UpgradeTo440.SettingMigration.Up()
   at FluentMigrator.MigrationBase.GetUpExpressions(IMigrationContext context)
   at FluentMigrator.Runner.MigrationRunner.<>c.<ApplyMigrationUp>b__69_0(IMigration m, IMigrationContext c)
   at FluentMigrator.Runner.MigrationRunner.ExecuteMigration(IMigration migration, Action`2 getExpressions)
   at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(IMigrationInfo migrationInfo, Boolean useTransaction)
   at FluentMigrator.Runner.MigrationRunner.Up(IMigration migration)
   at Nop.Data.Migrations.MigrationManager.ApplyUpMigrations(Assembly assembly, MigrationProcessType migrationProcessType)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.StartEngine(IApplicationBuilder application)
   at Program.<Main>$(String[] args)


I think the issue comes from an added property ShippingSorting in the Nop.Core.Domain.Shipping.ShippingSettings which wasn't there in 4.4. The ShippingSettings class is saved by the Nop.Web.Framework.Migrations.UpgradeTo440.SettingMigration but when you upgrade directly from 4.3 to 4.5 the ShippingSorting value doesn't exist in the database so it defaults to 0 which isn't a valid value for the Nop.Core.Domain.Shipping.ShippingSortingEnum and the upgrade fails.
This can be tested easily by creating a sample database in 4.3 and upgrading it directly to 4.5 without running 4.4 code on it.
Most people would upgrade their database directly from 4.3 to 4.5 without running it on 4.4 before that so that would be a big problem for them. I request this to be fixed since this will be a big problem for nopCommerce going forward since version skipping wouldn't work and upgrading your nopCommerce several versions up will be very frustrating having to run your database with the code of each version.

Note: I tested with the NoSource code version of nopCommerce 4.5.

Regards,
Anton
3 个月 前
Sergei-k wrote:
Hi, Boyko. I'm pretty sure this is a shadow copy and IIS pool issue that has been brought up many times and has a built-in solution. You can either turn on the CopyLockedPluginAssembilesToSubdirectoriesOnStartup setting or turn off the setting UsePluginsShadowCopy(both in AppSettings). In both cases, the error should disappear.


Hi Sergei,

Thank you for your reply!

Initially I simply turned off "UsePluginsShadowCopy" and I ended up with an error when trying to upload a package "Access to the path 'Nop.Plugin.Feed.GoogleShopping.dll' is denied." (which by the way is far better than not being able to start the site after being restarted).  That is why I reported it to you thinking it is something new in 4.50.
Anyway I can confirm that turning on "CopyLockedPluginAssembilesToSubdirectoriesOnStartup" seems to be working in 4.50 and it fixes the issue. Maybe you can think of having it enabled by default.

Thanks,
Boyko
3 个月 前
Nop-Templates.com wrote:

Initially I simply turned off "UsePluginsShadowCopy" and I ended up with an error when trying to upload a package "Access to the path 'Nop.Plugin.Feed.GoogleShopping.dll' is denied." (which by the way is far better than not being able to start the site after being restarted). [/b] "
Boyko


Just to follow up on the scenario above when "UsePluginsShadowCopy" is disabled and you try to upload a plugin's package and don't have permissions to delete the dll file of the plugin.
If you got this error ""Access to the path 'Nop.Plugin.Feed.GoogleShopping.dll' is denied." in the administration, although the site seems to be working in the beginning,  actually the uploaded plugin's folder is corrupted.  All files and folders inside the plugin will be deleted i.e Views, Content, plugin.json etc. except the dll file that was left because of the access error above.

In other words if you use this functionality and you don't have permissions then this would corrupt the installation and you end up with broken plugins.

Maybe you should improve the upload plugin functionality by trying to delete the plugin's dll file first and if it is not successful then do not delete the rest of the files thus not corrupting the original plugin. If the dll file is deleted successfully then you can go ahead and delete the other files of the plugin.

Thanks,
Boyko
3 个月 前
Guys.
Install any plugin from ZIP file from nop admin mode.
Restart the nopcommerce.
Try to upload the same ZIP file, you will see the crash of the screen. It's important issue.

Unhandled exception. System.Exception: Plugin 'PayPal Smart Payment Button'. Access to the path 'C:\Root\nop450\Plugins\bin\FoxNetSoft.Plugin.Payments.PayPalSmartPaymentButton.dll' is denied.
Access to the path 'C:\Root\nop450\Plugins\bin\FoxNetSoft.Plugin.Payments.PayPalSmartPaymentButton.dll' is denied.

---> System.Exception: Plugin 'PayPal Smart Payment Button'. Access to the path 'C:\Root\nop450\Plugins\bin\FoxNetSoft.Plugin.Payments.PayPalSmartPaymentButton.dll' is denied.
---> System.UnauthorizedAccessException: Access to the path 'C:\Root\nop450\Plugins\bin\FoxNetSoft.Plugin.Payments.PayPalSmartPaymentButton.dll' is denied.
   at System.IO.FileSystem.DeleteFile(String fullPath)
   at System.IO.File.Delete(String path)
   at Nop.Core.Infrastructure.NopFileProvider.DeleteFile(String filePath)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.ShadowCopyFile(INopFileProvider fileProvider, String assemblyFile, String shadowCopyDirectory)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, String assemblyFile, String shadowCopyDirectory, PluginConfig pluginConfig, INopFileProvider fileProvider)
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig)
   --- End of inner exception stack trace ---
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig)
   --- End of inner exception stack trace ---
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, WebApplicationBuilder builder)
   at Program.<Main>$(String[] args)