C# Web API在Visual Studio上运行,但在IIS上部署时不运行

C# Web API在Visual Studio上运行,但在IIS上部署时不运行,c#,iis,async-await,asp.net-web-api2,C#,Iis,Async Await,Asp.net Web Api2,我正在研究与CIDR/Aadhaar系统(印度个人独特身份识别系统)的集成。我选择了Nuget包,这是我找到的唯一可用选项。包数据已存在 我开发了一个控制台应用程序来测试代码,并获得了由提供的测试数据的成功结果。然后,我继续开发了一个Web API 2,它的工作方式与我从Visual Studio(使用IIS Express)运行该项目时完全相同。但在将其部署到IIS后,我遇到了以下异常(我从Nuget下载了包的源代码以查明原因): 有人能帮我理解这个错误吗 如果需要其他信息,请告诉我。我正在使

我正在研究与CIDR/Aadhaar系统(印度个人独特身份识别系统)的集成。我选择了Nuget包,这是我找到的唯一可用选项。包数据已存在

我开发了一个控制台应用程序来测试代码,并获得了由提供的测试数据的成功结果。然后,我继续开发了一个Web API 2,它的工作方式与我从Visual Studio(使用IIS Express)运行该项目时完全相同。但在将其部署到IIS后,我遇到了以下异常(我从Nuget下载了包的源代码以查明原因):

有人能帮我理解这个错误吗

如果需要其他信息,请告诉我。我正在使用Visual Studio 2017 RC进行开发,如果有必要的话

免责声明:代码片段也由包开发人员提供。我不认为这一切都是我的功劳

编辑: 根据评论,AggregateException的详细信息如下:


您需要知道“展开”AggregateException时发生的实际错误。它包含一个或多个异常,这些异常将提供导致此情况的实际异常。这可能是因为它无法执行HTTP调用(可能是您的生产服务器使用出站防火墙来阻止调用),或者使用了错误的URL(可能是您在生产中的应用程序具有不同的配置),或者完全是其他原因—如果没有正确的异常,您将尝试盲目修复。这一行(来自)是
XElement.Load(wait response.Content.ReadAsStreamAsync())
,但我认为它更有可能是一个,是前一行调用
ensureccessstatuscode()
并抛出的,因为您的服务返回了4xx或5xx状态。打开
AggregateException
(如@RB所说),您应该会得到您的答案。根据建议,我已经更新了AggregateException的详细信息。它表示
操作超时
。我不明白为什么这只发生在本地IIS上?可能是对服务器的HTTP调用。与本地URL相比,您在此处配置的URL可能不同?也许需要一个防火墙规则?@sellotape不,这是我在同一台机器上访问的同一个URL。。我不明白为什么我们需要检查防火墙规则,如果我可以从我的VS中点击URL。。你能帮忙吗?
[2017-02-07 11:52:44:434]  http://localhost/AadhaarAPI/api/Aadhaar : Type : System.AggregateException
[2017-02-07 11:52:44:434]  http://localhost/AadhaarAPI/api/Aadhaar : Error : One or more errors occurred.
[2017-02-07 11:52:44:520]  http://localhost/AadhaarAPI/api/Aadhaar : Stacktrace :    
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Uidai.Aadhaar.Agency.ApiClient`2.<GetResponseXmlAsync>d__25.MoveNext() in D:\Sujeet\VSProjects\AadhaarAPI\Uidai.Aadhaar\Agency\ApiClient.cs:line 138
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Uidai.Aadhaar.Agency.ApiClient`2.<GetResponseAsync>d__22.MoveNext() in D:\Sujeet\VSProjects\AadhaarAPI\Uidai.Aadhaar\Agency\ApiClient.cs:line 94
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Uidai.Aadhaar.Agency.ApiClient`2.<GetResponseAsync>d__21.MoveNext() in D:\Sujeet\VSProjects\AadhaarAPI\Uidai.Aadhaar\Agency\ApiClient.cs:line 78
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at AadhaarAPI.Controllers.AadhaarController.<AuthenticateAsync>d__13.MoveNext() in D:\Sujeet\VSProjects\AadhaarAPI\AadhaarAPI\Controllers\AadhaarController.cs:line 119
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AadhaarAPI.Controllers.AadhaarController.CheckIfAadhaarIsValid(PersonalInfo personalInfo) in D:\Sujeet\VSProjects\AadhaarAPI\AadhaarAPI\Controllers\AadhaarController.cs:line 53