4.10 not running on local system

1 year ago
Hi,

I download and run nopCommerce 4.10 show error on my local machine.

I have used Visual Studio 2017 with SQL Server 2014.

Error Details as:

System.Data.SqlClient.SqlException: 'Incorrect syntax near 'OFFSET'.
Invalid usage of the option NEXT in the FETCH statement.'

I check log file where error is below as:

System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'OFFSET'.
Invalid usage of the option NEXT in the FETCH statement.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.BufferlessMoveNext(DbContext _, Boolean buffer)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
   at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider._TrackEntities[TOut,TIn](IEnumerable`1 results, QueryContext queryContext, IList`1 entityTrackingInfos, IList`1 entityAccessors)+MoveNext()
   at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
   at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Nop.Core.PagedList`1..ctor(IQueryable`1 source, Int32 pageIndex, Int32 pageSize, Boolean getOnlyTotalCount) in D:\Amit_Kumar\nopCommerce_Plugins\nopCommerce_4.10_Source\Libraries\Nop.Core\PagedList.cs:line 34
   at Nop.Services.Logging.DefaultLogger.GetAllLogs(Nullable`1 fromUtc, Nullable`1 toUtc, String message, Nullable`1 logLevel, Int32 pageIndex, Int32 pageSize) in D:\Amit_Kumar\nopCommerce_Plugins\nopCommerce_4.10_Source\Libraries\Nop.Services\Logging\DefaultLogger.cs:line 150
   at Nop.Web.Areas.Admin.Factories.LogModelFactory.PrepareLogListModel(LogSearchModel searchModel) in D:\Amit_Kumar\nopCommerce_Plugins\nopCommerce_4.10_Source\Presentation\Nop.Web\Areas\Admin\Factories\LogModelFactory.cs:line 80
   at Nop.Web.Areas.Admin.Controllers.LogController.LogList(LogSearchModel searchModel) in D:\Amit_Kumar\nopCommerce_Plugins\nopCommerce_4.10_Source\Presentation\Nop.Web\Areas\Admin\Controllers\LogController.cs:line 67
   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 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 D:\Amit_Kumar\nopCommerce_Plugins\nopCommerce_4.10_Source\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.Core.Http.InstallUrlMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in D:\Amit_Kumar\nopCommerce_Plugins\nopCommerce_4.10_Source\Libraries\Nop.Core\Http\InstallUrlMiddleware.cs:line 51
   at Nop.Core.Http.KeepAliveMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in D:\Amit_Kumar\nopCommerce_Plugins\nopCommerce_4.10_Source\Libraries\Nop.Core\Http\KeepAliveMiddleware.cs:line 50
   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.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
ClientConnectionId:514765cb-d705-4d60-af27-6304cb17549c
Error Number:102,State:1,Class:15
1 year ago
Did you restore an older SQL DB on the server?
https://www.spiria.com/en/blog/web-applications/understanding-sql-server-compatibility-levels
1 year ago
Hello,

I was getting the same error when I installed nopCommerce 4.10 on SQL Server 2008.

As a.m. stated here, you will need to set "UseRowNumberForPaging" to "true" in appsettings.json.

Hope that helps!

Regards,
Anton
1 year ago
Hello Anton,

Thanks for your quick reply!

I set "UseRowNumberForPaging" to "true" in appsettings.json after that nopCommerce 4.10 Running.

Thanks Again!
1 week ago
I have the same problem but it is still not working .

Actually it was working fine on mssql version 2012  express edition and i upgraded from express edition to web edition now non of the 4.1 version is working
1 week ago
[email protected] wrote:
...now none of the 4.1 version is working


Are you  getting the exact error message as above " System.Data.SqlClient.SqlException: 'Incorrect syntax near 'OFFSET'."?
1 week ago
[email protected] wrote:
I have the same problem but it is still not working .

If your issue is same, then make sure this version supports OFFSET FETCH clauses. If it doesn’t, then change it.