【发布时间】:2014-04-09 11:20:11
【问题描述】:
我正在开发一个使用 WebApi2 和 MVC 以及 Angular 和 D3 api 的示例项目。我的 WebApi 遇到问题。使用 Azure 数据库连接字符串在本地计算机上一切正常,但是当我在 Azure 上发布相同内容时,我的 HttpPost 停止工作,而 HttpGet 工作正常。
[HttpPost]
[Route("api/dashboard/addnewassignment")]
public WebApiD3Sample.ViewModels.CoursePersonAssignmentModel AddNewCoursePersonAssignment([FromBody]WebApiD3Sample.ViewModels.CoursePersonAssignmentModel model)
{
if (ModelState.IsValid) {
var modelAfterSave = AssignmentService.AddAssignment(model);
return modelAfterSave;
}
ModelState.AddModelError("Invalid", "Not a Valid Save");
return model;
}
我在发布时面临的错误
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
http://sampledataweb.azurewebsites.net/api/dashboard/addnewassignment
Object
message: "An error has occurred."
__proto__: Object
【问题讨论】:
-
看起来不是 azure 特有的问题,请提供更多详细信息。
-
详情像什么??这是网站网址http://sampledataweb.azurewebsites.net/
标签: c# azure asp.net-web-api