Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hi, When I click on the cleared button on the product sheet it gives me this error (nop 4.2):
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
and does not add the product to my cart
3 years ago
Please clarify "cleared button on the product sheet".
(A screen capture may be helpful)
3 years ago
Sorry!
here is the screenshot of the reported error.

http://www.e-direct.eu/errore.jpg
Thk
3 years ago
This happen when you click the "add to cart" button?

In any case, check the System > Log to see if any error reported.
Also, the debugger seems to show an error related to the nop-templates (seven-spikes) theme, so you may need to contact them.
3 years ago
New York wrote:
This happen when you click the "add to cart" button?
Yes

In any case, check the System > Log to see if any error reported.
Also, the debugger seems to show an error related to the nop-templates (seven-spikes) theme, so you may need to contact them.


System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at Nop.Web.Controllers.ShoppingCartController.GetProductToCartDetails(List`1 addToCartWarnings, ShoppingCartType cartType, Product product) in C:\Workspace_VS2019\Nop_4.20_Savcar\src\Presentation\Nop.Web\Controllers\ShoppingCartController.cs:line 613
   at Nop.Web.Controllers.ShoppingCartController.AddProductToCart_Details(Int32 productId, Int32 shoppingCartTypeId, IFormCollection form) in C:\Workspace_VS2019\Nop_4.20_Savcar\src\Presentation\Nop.Web\Controllers\ShoppingCartController.cs:line 928
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at WebMarkupMin.AspNetCore2.WebMarkupMinMiddleware.Invoke(HttpContext context)
   at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 94
   at Nop.Services.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) in C:\Workspace_VS2019\Nop_4.20_Savcar\src\Libraries\Nop.Services\Authentication\AuthenticationMiddleware.cs:line 79
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Nop.Services.Installation.InstallUrlMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in C:\Workspace_VS2019\Nop_4.20_Savcar\src\Libraries\Nop.Services\Installation\InstallUrlMiddleware.cs:line 52
   at Nop.Services.Common.KeepAliveMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in C:\Workspace_VS2019\Nop_4.20_Savcar\src\Libraries\Nop.Services\Common\KeepAliveMiddleware.cs:line 49
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
3 years ago
RE: ...\Presentation\Nop.Web\Controllers\ShoppingCartController.cs:line 613

In admin Languages, check the Resource named
Products.ProductHasBeenAddedToTheCart.Link

In the default site it should look like this
  The product has been added to your <a href="{0}">shopping cart</a>
3 years ago
http://www.e-direct.eu/screen_risorsa.jpg
Thanks ... but everything looks ok!
I don't understand what it can be.
3 years ago
You have both {0} and {1}.   Why do you have {1}?  (Remove it)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.