我在主机环境中启用了 CORS -- global.asax 文件。 我正在尝试将数据从一个域发布到另一个域。
我正在尝试从 JQuery 发出 post api 请求。此请求在 chrome 中被取消,状态代码 500 在 firefox 中返回。在本地环境中使用相同的配置请求成功,但在部署后失败。
我正在使用 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)
最佳答案
通过
更正了上述问题解决项目和 IIS 中的框架问题, 在 IIS 中,应用程序映射到 2.0 框架,在 Vs2012 中,目标框架是 4.5。
确保 openrasta url 可访问且不返回 404 状态代码。
关于iis-7 - OpenRasta post 请求在 chrome 中取消,firefox 中的 500 状态代码,跨域请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19208674/