iis-7 - OpenRasta post 请求在 chrome 中取消,firefox 中的 500 状态代码,跨域请求

标签 iis-7 nullreferenceexception openrasta

我在主机环境中启用了 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)

最佳答案

通过

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

  2. 确保 openrasta url 可访问且不返回 404 状态代码。

关于iis-7 - OpenRasta post 请求在 chrome 中取消,firefox 中的 500 状态代码,跨域请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19208674/

相关文章:

iis - Windows 身份验证通过反向代理问题

c# - System.Collections.Generic.LinkedList`1.AddLast(T 值)中的 NullReferenceException

OpenRasta - 将错误编码为 JSON 而不是 HTML

asp.net - 为什么事件代码:4011显示为信息

php - 使用 Delphi 2010 和 php4Delphi 编写 PHP 扩展

c# - 如何找出导致 NullReferenceException 的原因

c# - 无法使用 foreach 获取 XML 值

javascript - OpenRasta CreatedResourceUrl 使用

openrasta - 在 OpenRasta 中,如何配置一个 URI,其中我将 "the remainder of the path"作为单个字符串获取?

asp.net-mvc - ASP.NET MVC运行IIS7部署问题