Cors를 사용할 수있는 WebAPI가 있습니다.WebAPI에서 참조 된 dll을 호출하면 로컬에서는 작동하지만 서버에서는 작동하지 않습니다.
내 webAPI 내가의 처리를 많이 할 클래스 라이브러리를 참조합니다.이 오류를 던지는 WebAPI 및 클래스 라이브러리와도 클래스 라이브러리 내부의 호출은
사이
전화를 ...
{"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.",
"ExceptionType":"System.NullReferenceException","StackTrace":"
at RCIS.MappingServices.WebAPI.Utilities.SQL.SQLInsertObjects(Int32 TypeMapId, Int32 GrowerId, Int32 CropYear, String NAME, String SHAPE, String CREATED_BY, String CREATED_DATETIME, String MODIFIED_BY, String MODIFIED_DATETIME, String IsDELETED)\r\n
at RCIS.MappingServices.WebAPI.Controllers.PostObjectsController.GET(String TypeMapId, String GrowerId, String CropYear, String NAME, String SHAPE)\r\n
at lambda_method(Closure , Object , Object[])\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}
이 만 나는 WebAPI 메소드를 호출 크롬에 URL을 입력하고 다시이 오류가 서버 (예)에서 클래스 라이브러리를 호출 할 때 발생하는 것으로 보인다.
WebAPI의 모든 기본 유형을 사용하고 클래스 라이브러리에서 성공 메시지를 다시받습니다.
질문 사항이 있으면 알려 주시기 바랍니다. 이것에 대한 도움은 크게 2 일 동안이 문제를 해결하기 위해 노력 해왔다!
이 문제에 대한 해결책을 찾았습니까? 나는 비슷한 문제가있다. –