Plugin installation problem

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 năm cách đây
Nop version 4.30, new plugin, can't be installed. Can you see anything in this stack trace that points to what the problem might be?

System.FormatException: String '' was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExactMultiple(ReadOnlySpan`1 s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
   at System.DateTime.ParseExact(ReadOnlySpan`1 s, String[] formats, IFormatProvider provider, DateTimeStyles style)
   at Nop.Data.Migrations.NopMigrationAttribute..ctor(String dateTime, String description) in D:\ACT\nopCommerce_4.30\Libraries\Nop.Data\Migrations\NopMigrationAttribute.cs:line 29
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(MemberInfo element, Type type, Boolean inherit)
   at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](MemberInfo element)
   at FluentMigrator.Runner.Infrastructure.DefaultMigrationRunnerConventions.GetMigrationInfoForMigrationImpl(IMigration migration)
   at Nop.Data.Migrations.MigrationManager.<>c__DisplayClass10_0.<GetMigrations>b__1(IMigration m) in D:\ACT\nopCommerce_4.30\Libraries\Nop.Data\Migrations\MigrationManager.cs:line 154
   at System.Linq.Utilities.<>c__DisplayClass2_0`3.<CombineSelectors>b__0(TSource x)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.ToArray()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()
   at Nop.Data.Migrations.MigrationManager.ApplyUpMigrations(Assembly assembly, Boolean isUpdateProcess) in D:\ACT\nopCommerce_4.30\Libraries\Nop.Data\Migrations\MigrationManager.cs:line 180
   at Nop.Services.Plugins.PluginService.InsertPluginData(Type pluginType, Boolean isUpdateProcess) in D:\ACT\nopCommerce_4.30\Libraries\Nop.Services\Plugins\PluginService.cs:line 193
   at Nop.Services.Plugins.PluginService.InstallPlugins() in D:\ACT\nopCommerce_4.30\Libraries\Nop.Services\Plugins\PluginService.cs:line 466
4 năm cách đây
amp838 wrote:
System.FormatException: String '' was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExactMultiple(ReadOnlySpan`1 s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)

I assume you have this attribute
    [NopMigration("2021/03/11 09:40:55:1687541", "Plugin.Group base schema")]
The date needs to be a valid date that can be Parsed to DateTime
4 năm cách đây
Sure enough, the attribute's datetime field was empty, as initially copied by the plugin template. I am fairly new in nopcommerce and don't even know yet what migration is, so I would have never figured this out by myself. Maybe a note in the documentation for new developers?
In any case, after filling the field with the datetime you suggested, the plugin is now nicely installed. Thank you very much for your help.
4 năm cách đây
The date value is stored in the table MigrationVersionInfo table
If you ever make changes to the plugin and you want the install to be available to update or change existing tables you need to change this date to a date after the last date entered
4 năm cách đây
Hello @amp838
1. The user has only two options for uploading or installing the plugin in nopcommerce;
First step is to Upload the plugin to the /plugins folder in your nopCommerce directory. And restart your application (or click Reload list of plugins button).

Second step is to Upload the plugin or theme using the Upload plugin or theme button indicating the path to the location of the archive with the plugin in your local storage.

2. Scroll down through the list of plugins to find the newly installed plugin.
3. Click on the Install link to install the plugin.
4. Click on the Restart application to apply changes button on the top panel to finish the installation process.
5. The plugin is displayed in the plugins list.

Read More - https://docs.nopcommerce.com/en/getting-started/advanced-configuration/plugins-in-nopcommerce.html
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.