[英]SWAGGER Error. The server encountered an error processing the request
I'm getting this error in swagger UI. 我在招摇的用户界面中收到此错误。 I'm stock in this error for almost 3 days.
我有将近3天的时间库存此错误。 Please help me what is the problem.
请帮我什么问题。 I'm using this as my references https://github.com/abelsilva/swaggerwcf
我使用它作为我的参考https://github.com/abelsilva/swaggerwcf
[OperationContract]
[WebInvoke(Method = "PUT",
UriTemplate = "UpdateJob/{UserName}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json)]
[SwaggerWcf.Attributes.SwaggerWcfPath("Update Job", "Update a job in Portal")]
PortalJob UpdateJob(
[SwaggerWcfParameter(true, "This is the Username assigned to a company to allow service processing")]
String UserName,
[SwaggerWcfParameter(true, "This is the populated job object")]
PortalJob job);
Here's my sample json entry: 这是我的示例json条目:
{
"UserName": "Manila_user",
"JobID": 157,
"Site": "ATL",
"SiteID": 1,
"ClientName": "Manila Devs",
"ClientID": 14,
"ParentProductName": "Manila Parent Product",
"ProductID": 1519,
"JobStatus": "Received",
"JobStatusID": 1,
"UniqueID": 0,
"RecordAddedDate": "2016-12-12",
"ReceivedDate": "2016-12-12",
"ReleaseDate": "2016-12-12",
"RequiredMailDate": "2016-12-12",
"PrintedDate": "2016-12-12",
"MailedQuantity": 25,
"MailedDate": "2016-12-12",
"BillingQuantity": 0,
"InvoiceNumber": "11",
"InvoiceDate": "2016-12-12",
"RejectedQuantity": 0,
"RejectedReason": "test",
"ActiveRecord": 0,
"RecordLastChangedBy": "WCF",
"RecordLastChangedDate": "2016-12-12",
"SequenceNum": 0,
"StatusEventDate": "2016-12-12",
"StatusEventChangedBy": "WCF",
"Notes": "test",
"OnlineApproval": "2016-12-12",
"UserApproval": 0,
"FileID": 170,
"FileName": "test",
"ReceivedQuantity": 0,
"JobNumber": 0,
"GroupName": "Manila Group",
"Flex1": "string 1",
"Flex2": "string 2",
"Flex3": "string 3",
"TrackingID": 123,
"ImpressionCount": 0,
"GroupID": 5358
}
I received this error with SwaggerWCF as well. 我也收到SwaggerWCF的此错误。 I was able to determine the problem was a dependency on Newtonsoft.Json by enabling tracing on my application.
通过在我的应用程序上启用跟踪 ,我能够确定问题是对Newtonsoft.Json的依赖。 Here was the error I found.
这是我发现的错误。
System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.
System.IO.FileLoadException:无法加载文件或程序集“ Newtonsoft.Json,版本= 8.0.0.0,文化=中性,PublicKeyToken = 30ad4fe6b2a6aeed”或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference.
找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040)
(来自HRESULT的异常:0x80131040)
I reinstalled Newtonsoft through NuGet and that resolved my problem. 我通过NuGet重新安装了Newtonsoft,这解决了我的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.