OpenRasta post request cancelled in chrome , 500 status code in firefox, Cross Domain Requests

303 views Asked by At

I have enabled CORS in the Host Environment -- global.asax file. I am trying to post data from one domain to another.

I am trying to fire a post api request from JQuery. This request gets cancelled in chrome and status code 500 is returned in firefox. The reuquest succeeds with the same configurations in local environment but fails after deploying.

I am using openrasta, c#, CORS, IIS7 7.5.

Exception captured via Elmah.

System.NullReferenceException: Object reference not set to an instance of an object.
   at OpenRasta.Hosting.AspNet.AspNetLogSourceExtensions.StartPreExecution(ILogger`1 log)
   at OpenRasta.Hosting.AspNet.OpenRastaModule.HandleHttpApplicationPostResolveRequestCacheEvent(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
1

There are 1 answers

0
sham On

Corrected the above issue by

  1. Resolving the framework issues for the project and in IIS, In IIS the application was mapped to 2.0 framework and in Vs2012 the target framework was 4.5.

  2. Ensuring that openrasta urls are accessible and not returning 404 status code.