samedi 27 février 2021

WEB API does not work anymore after I publish to local IIS server

I follow this article ("https://ift.tt/3pVp4bq) and create simple web api within VS 2019 and using IIS express to test, everything working(return result as json file and I can open it) as it support to be. But after I publish to local IIS server, I never get result (I can still see the file return, but NOT downloadable). Does anyone know how to fix that?

BTW, I am following this article ("https://ift.tt/3b1UE30) to publish to local IIS server. FYI.

Below is the detail error message : "{ "Message": "An error has occurred.", "ExceptionMessage": "Keyword not supported: 'server'.", "ExceptionType": "System.ArgumentException", "StackTrace": " at System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions.ParseInternal(IDictionary2 parsetable, String connectionString, IList1 validKeywords)\r\n at System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions..ctor(String connectionString, IList1 validKeywords)\r\n at System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)\r\n at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)\r\n at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config)\r\n at System.Data.Entity.Internal.LazyInternalConnection.Initialize()\r\n at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()\r\n at System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context)\r\n at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()\r\n at System.Data.Entity.Internal.InternalContext.Initialize()\r\n at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)\r\n at System.Data.Entity.Internal.Linq.InternalSet1.Initialize()\r\n at System.Data.Entity.Internal.Linq.InternalSet1.GetEnumerator()\r\n at System.Collections.Generic.List1..ctor(IEnumerable1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)\r\n at EmployeeService.Controllers.EmployeesController.Get() in C:\Users\xxxx\source\repos\EmployeeService\EmployeeService\Controllers\EmployeesController.cs:line 16\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.b__2(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__15.MoveNext()" }"

Thanks!




Aucun commentaire:

Enregistrer un commentaire