2013-10-06 26 views
3

我在主机环境 - global.asax文件中启用了CORS。 我想将数据从一个域发布到另一个域。OpenRasta发布的请求在chrome中取消,500个状态码在firefox中,跨域请求

我想从jQuery发起一个post api请求。这个请求在chrome中被取消,状态码500在firefox中返回。 reuquest在本地环境中使用相同的配置成功,但在部署后失败。

我正在使用openrasta,c#,CORS,IIS7 7.5。

通过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) 
+0

您应该在答案中发布解决方案的详细信息。告诉我们是什么使您了解该解决方案并显示详细信息。然后你可以接受你自己的答案(并获得积分),其他人可以提高你的答案(并给你更多的积分)。 –

+0

肯定会这样做 – sham

回答

4

通过

  1. 修正上述问题解决了该项目,并在IIS中的框架问题, 在IIS应用程序被映射到2.0框架和Vs2012目标框架是4.5。

  2. 确保可以访问openrasta的URL并且不返回404状态码。