RC1 - Exception thrown: 'Microsoft.AspNet.Server.Kestrel.Networking.UvException' in mscorlib.dll
I have a simple ASP.NET 5 MVC 6 app where the controller's action simply returns a string using return Content(); So No views in play. I've got the bare minimum services configured. The controller action is async and it calls another method that is also async. Its implementation looks like this
private async Task<string> GetData()
{
await Task.Delay(10);
return "Some data";
}
I run the app and in the browser I keep the F5 key pressed. I'll start to see these exceptions. in the Output window in VS.
I see this with both IIS Express as well as Kestrel. If I replace the Task.Delay() with Task.Yield() I don't see these exception. There are no exceptions in my application code itself. leaving the F5 key for 10 seconds and once again keeping it pressed (and repeating this process) generates large number of exceptions (exponential growth almost).
Are you returning a Task<string> from the action? Your code shouldn't compile as is.
I'll start to see these exceptions
Do you have a stack trace for these exceptions?
There is no stack trace. Essentially there is no exception in my application itself ( don't see the debugger break or don't see an Exception page).
Yea, Task
So yes, it complies and works.
Doesn't compile:
is an async method that returns 'Task', a return keyword must not be followed by an object expression. Did you intend to return 'Task
'?
What do you see in the output window?
I'm not sure what you mean. The project complies and runs. The project.json file has "frameworks": { "dnx451": { } },
This is the implementation of the method
private async Task<string> GetData2()
{
await Task.Delay(10);
return "Hash Code: ";
}
Are you certain the signature of your method isn't private async Task<string> GetData2()? What you have here shouldn't compile. A void Task cannot return a value.
Yes it is. I guess the angle brackets are not being seen. Sorry I should have previewed and examine my posts correctly. I see now why you're wondering how my code is compiling. Just to be clear the method returns a Task of string.
Does this still repro?
I have just encountered the same issue, which apparently was caused by specifying the server url in the project.json and then trying to run from within VS.
Removing all parameters from the web command in the project.json for the affected web apps fixed the issue for me.
This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.