我在Host Environment中启用了CORS - global.asax文件。 我试图将数据从一个域发布到另一个域。
我正在尝试从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 :(得分:4)
通过
纠正了上述问题解决项目和IIS中的框架问题, 在IIS中,应用程序映射到2.0框架,在Vs2012中,目标框架是4.5。
确保openrasta网址可访问且不返回404状态代码。