وقت بخیر. من سعی کردم پروژه رو پابلیش کنم ولی error 500 میده با پشتیبانی تماس گرفتم میگه مشکل از کدهایی ک نوشتی.قبل پابلیش پروژه رو به .net 9 آپدیت کردم و پشتیبان هم همین نسخه رو روی سرور نصب کرده. اینم log :
warn: Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
Using an in-memory repository. Keys will not be persisted to storage.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[59]
Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {38f7dd8b-b5b4-4856-a794-b60891587eae} may be persisted to storage in unencrypted form.
info: Microsoft.Hosting.Lifetime[14]
Now listening on:http://127.0.0.1:27040
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\inetpub\vhosts\royaonlineshop.ir
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'User' has a global query filter defined and is the required end of a relationship with the entity 'Order'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'Product' has a global query filter defined and is the required end of a relationship with the entity 'OrderDetail'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'Role' has a global query filter defined and is the required end of a relationship with the entity 'RolePermission'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'Product' has a global query filter defined and is the required end of a relationship with the entity 'ProductComment'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'Product' has a global query filter defined and is the required end of a relationship with the entity 'ProductVote'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'User' has a global query filter defined and is the required end of a relationship with the entity 'UserDiscountCode'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'Product' has a global query filter defined and is the required end of a relationship with the entity 'UserProduct'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10622]
Entity 'Role' has a global query filter defined and is the required end of a relationship with the entity 'UserRole'. This may lead to unexpected results when the required entity is filtered out. Either configure the navigation as optional, or define matching query filters for both entities in the navigation. Seehttps://go.microsoft.com/fwlink/?linkid=2131316for more information.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HN89ERGUFGC7", Request id "0HN89ERGUFGC7:00000001": An unhandled exception was thrown by the application.
System.ArgumentException: Keyword not supported: 'userid'.
at Microsoft.Data.SqlClient.SqlConnectionStringBuilder.GetIndex(String keyword)
at Microsoft.Data.SqlClient.SqlConnectionStringBuilder.set_Item(String keyword, Object value)
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
at Microsoft.Data.SqlClient.SqlConnectionStringBuilder..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.<>c.<get_IsMultipleActiveResultSetsEnabled>b__7_0(String cs)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.get_IsMultipleActiveResultSetsEnabled()
at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerCompiledQueryCacheKeyGenerator.GenerateCacheKey(Expression query, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1.GetEnumerator() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at OnlineShop.Core.Services.ProductService.GetPopularProducts() in J:\Projects\OnlineShop\OnlineShop.Core\Services\ProductService.cs:line 238
at OnlineShop.Web.Controllers.HomeController.Index() in J:\Projects\OnlineShop\OnlineShop.Web\Controllers\HomeController.cs:line 22
at lambda_method1(Closure, Object, Object[])
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at OnlineShop.Web.Program.<>c.<<Main>b__0_4>d.MoveNext() in J:\Projects\OnlineShop\OnlineShop.Web\Program.cs:line 71
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
سلام
ارور 500 یعنی در کدها مشکلی هست
متن خطا را در گوگل سرچ راهنماهای زیادی داره که باید مطالعه بفرمائید
تو vs خطایی نمیده استاد
بله این خطا تو سرور هست
Logging را فعال کنید تا جزئیات کاملی بدست بیارید
یا از Elmah استفاده کنید