3

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)
sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
sham
  • 691
  • 8
  • 28
  • You should post details of your solution in an answer. Tell us what led you to this solution and show details. You can then accept your own answer (and get points), and others can upvote your answer (and give you more points). – John Saunders Oct 13 '13 at 02:54

1 Answers1

4

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.

sham
  • 691
  • 8
  • 28