-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to launch kestrel-based console app #789
Comments
@aggieben this doesn't sound like an issue with the C# extension - it sounds like building your app isn't setting up the output directory such that your app actually runs. What template are you starting your app from? |
I started with dotnet new, I think. What do you mean about the output directory? I don't think I've done anything to affect that. |
Your app is crashing because it can't find Microsoft.AspNetCore.Server.Kestrel.dll. I am not a super expert on assembly resolution, but from my understanding there are two places where the runtime might go to try and find the assembly - next to the app itself, or in the 'shared framework' directory. |
Ah, just was able to get back to my desk and definitely I used Here's my project.json: "version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"preserveCompilationContext": true,
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNetCore.Http.Abstractions": "1.0.*",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.*",
"Microsoft.Extensions.DependencyInjection": "1.0.*",
"Microsoft.EntityFrameworkCore": "1.0.*",
"Microsoft.EntityFrameworkCore.Design": {
"version": "1.0.0-*",
"type": "build"
},
"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.*",
"Npgsql.EntityFrameworkCore.PostgreSQL.Design": {
"version": "1.0.*",
"type": "build"
},
"MyNamespace.Extensions": {
"target": "project"
}
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-*"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.*",
"type": "platform"
}
}
}
}
} The way I've been testing my app is simply to do |
Just to be clear, this is still broken for me. I can run my application on the console with
I am at a bit of a loss and would like to be able to use the debugger but currently can't. |
Is this still an issue? Note, the problem is likely not an issue with C# for Visual Studio. |
If you're still able to reproduce the problem, could you provide a copy of a project that exhibits this behavior? I tried to cobble together something from the information that you provided above, but had to tweak enough to get it to compile that I'm not confident my final project is similar to what you have. However, even then, I wasn't able to reproduce. If you have something you can provide that reproduces the issue, please let us know. |
I think somewhere along the way an update to the tooling resolved it; I'm not experiencing this issue anymore. |
Glad to hear it! |
Environment data
dotnet --info
output:VS Code version:
C# Extension version: 1.4.1
Steps to reproduce
Build kestrel app with a Main that looks like this:
Then after opening the project in VsCode and the extension goes through it's first-time setup, try to launch the app with F5 or the launcher.
Expected behavior
My app running with symbols loaded in the debugger.
Actual behavior
A break on this:
After I click the button to continue, the following error appears in the console:
and then the process exits.
I tried referencing Kestrel explicitly in my project.json (version
1.0.*
), but that didn't change anything.The text was updated successfully, but these errors were encountered: