AWS Lamba无服务器.Net C#应用程序错误

时间:2017-02-17 16:34:53

标签: c# .net amazon-web-services aws-lambda serverless-framework

尝试使用Visual Studio模板在AWS Lamba中使用Lamba函数时出错。当我部署到lamba并尝试测试我的函数时,我得到以下错误。我没有真正改变项目的任何内容,只是按照它给出的那样。

我一直试图弄清楚问题是什么,但我无法做到。这是我第一次学习Lamba和无服务器架构。有什么想法吗?

START RequestId: 65fd2b6c-f52e-11e6-ae87-4f4e1852036a Version: $LATEST
Incoming  requests to [Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request starting   https://apigateway--   
Unknown error responding to request: NullReferenceException:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Routing.Internal.PathTokenizer.get_Count()
   at Microsoft.AspNetCore.Routing.Tree.TreeRouter.TreeEnumerator.MoveNext()
   at Microsoft.AspNetCore.Routing.Tree.TreeRouter.<RouteAsync>d__13.MoveNext()
--- 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 Microsoft.AspNetCore.Routing.RouteCollection.<RouteAsync>d__9.MoveNext()
--- 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 Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- 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 Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- 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 Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction.<ProcessRequest>d__15.MoveNext()
NullReferenceException:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Routing.Internal.PathTokenizer.get_Count()
   at Microsoft.AspNetCore.Routing.Tree.TreeRouter.TreeEnumerator.MoveNext()
   at Microsoft.AspNetCore.Routing.Tree.TreeRouter.<RouteAsync>d__13.MoveNext()
--- 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 Microsoft.AspNetCore.Routing.RouteCollection.<RouteAsync>d__9.MoveNext()
--- 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 Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- 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 Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- 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 Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction.<ProcessRequest>d__15.MoveNext()
[Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request finished in 4680.1609ms 0  
END RequestId: 65fd2b6c-f52e-11e6-ae87-4f4e1852036a
REPORT RequestId: 65fd2b6c-f52e-11e6-ae87-4f4e1852036a  Duration: 7974.44 ms    Billed Duration: 8000 ms    Memory Size: 128 MB Max Memory Used: 46 MB  

1 个答案:

答案 0 :(得分:0)

面临同样的问题。在创建项目之前,您需要在visual studio中连接到AWS explorer。在AWS控制台门户中创建一个单独的帐户,然后重试。