Paths to included files gets messed up in MVC
From @JerkerPihl on December 21, 2016 22:58
- VSCode Version: Code 1.8.1 (ee428b0eead68bf0fb99ab5fdc4439be227b6281, 2016-12-19T14:49:23.350Z)
- OS Version: Windows_NT ia32 10.0.14393
- Extensions:
| Extension | Author | Version |
|---|---|---|
| aessoft-class-autocomplete | AESSoft | 0.1.0 |
| githistory | donjayamanne | 0.1.4 |
| jquerysnippets | donjayamanne | 0.0.1 |
| vscode-html-css | ecmel | 0.0.30 |
| csharp | ms-vscode | 1.6.0 |
| mono-debug | ms-vscode | 0.12.0 |
| debugger-for-chrome | msjsdiag | 2.4.1 |
| vscode-docker | PeterJausovec | 0.0.10 |
Steps to Reproduce:
- Create asp.net MVC with auth project from yo with aspnet generator
- Run project with dotnet run (works great, all path to jquery and stuff is correct)
- Exit and Open it in Code
- Run debugger, no paths to included javascript/jquery are correct
Copied from original issue: Microsoft/vscode#17704
Hmmm... is this a working directory issue? cc @gregg-miskelly
@JerkerPihl this sounds like a dupe of https://github.com/OmniSharp/omnisharp-vscode/issues/799. If so, this isn't a bug in the extension but rather some combination of by design/a documentation issue with the template. Either way, if this is the same issue -- run bower install to fix it.
Tried bower.. was installed but wanted to updated. Updated didnt help Still doesnt explain if I run webbapp in shelfhosted console app, every path gets right but when I run in vscode included paths get wrong.
I had to update the cwd property in the launch.json file so my config file (/src/web/appsettings.json) could be found when debugging.
@davidsk @sayedihashimi does this sound like a bug with the 'yo aspnet' generator? Or with the default launch.json that we generate, or neither and just something that we document?
The default launch.json sets the cwd to ${workspaceRoot} which I imagine is fine when running a HelloWorld console app but not when nesting your projects in folders e.g src/web. I suppose it should be documented, not sure there's anything else that can be done.
My launch.json was created by the extension, not yeoman.
@davidsk In that case, I think we could fix the launch.json generation code to default cwd to the workspace-relative directory of the project. (ex: ${workspaceRoot}/src/web).
If you can determine the correct path then I'm sure that'd save some confusion.