I’ve got an oddball CORS issue and I’m wondering if anyone else has run into it before. (Pinging @bconner and @Olga. Thanks in advance!)
I’m getting the following error when trying to access REST services in my production environment.
Method not found: ‘Void Microsoft.Owin.Cors.CorsPolicyProvider.set_PolicyResolver(System.Func
2<Microsoft.Owin.IOwinRequest,System.Threading.Tasks.Task
1<System.Web.Cors.CorsPolicy>>)’.
REST is functional in my Training DB and the Web.Config’s are the same, aside from the instance-specific stuff. I’m at a bit of a loss honestly.
Thanks so much to anyone that can shed some light on this one.
The full error is below:
Method not found: ‘Void Microsoft.Owin.Cors.CorsPolicyProvider.set_PolicyResolver(System.Func2<Microsoft.Owin.IOwinRequest,System.Threading.Tasks.Task
1<System.Web.Cors.CorsPolicy>>)’.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: Method not found: ‘Void Microsoft.Owin.Cors.CorsPolicyProvider.set_PolicyResolver(System.Func2<Microsoft.Owin.IOwinRequest,System.Threading.Tasks.Task
1<System.Web.Cors.CorsPolicy>>)’.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[MissingMethodException: Method not found: ‘Void Microsoft.Owin.Cors.CorsPolicyProvider.set_PolicyResolver(System.Func2<Microsoft.Owin.IOwinRequest,System.Threading.Tasks.Task
1<System.Web.Cors.CorsPolicy>>)’.]
Epicor.RESTApi.ConfigureStartup.ConfigureCors(IAppBuilder app) in c:_Releases\ICE\3.1.600.0\Source\Framework\Epicor.RESTApi\Startup.cs:91
Epicor.RESTApi.<>c.b__0_1(IAppBuilder site) in c:_Releases\ICE\3.1.600.0\Source\Framework\Epicor.RESTApi\Startup.cs:28
Owin.MapWhenExtensions.MapWhen(IAppBuilder app, Func2 predicate, Action
1 configuration) +168
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments) +128
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture) +142
Owin.Loader.<>c__DisplayClass12.b__b(IAppBuilder builder) +93
Owin.Loader.<>c__DisplayClass1.b__0(IAppBuilder builder) +212
Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1 startup) +873 Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action
1 startup) +51
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +101
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +135
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +160
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers) +580
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context) +165
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +267
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688