Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Debugging server and client with F5? #35

Open
alexbenitez opened this issue Sep 18, 2018 · 4 comments
Open

Debugging server and client with F5? #35

alexbenitez opened this issue Sep 18, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@alexbenitez
Copy link

The tasks.json is pointing to a not existing server.csproj. Wonder if you could update the starter with a launch.json and tasks.json so developer can debug client and server code with VS Code... is this possible as is it right now ? (or alternative instructions)

{
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "build", 
            "command": "dotnet",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}/server.csproj"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}
@alexbenitez
Copy link
Author

OK... I added the missing /server folder to
launch.json

"program": "${workspaceFolder}/server/bin/Debug/netcoreapp2.1/server.dll",

and tasks.json

"${workspaceFolder}/server/server.csproj"

However it can't find the aspnet-webpack module. I don't see aspnet-webpack used in the latest MS template... is this module compatible with Microsoft.AspNetCore.All 2.1.3?

xception has occurred: CLR/System.AggregateException
An unhandled exception of type 'System.AggregateException' occurred in System.Private.CoreLib.dll: 'One or more errors occurred.'
 Inner exceptions found, see $exception in variables window for more details.
 Innermost exception 	 Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException : Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\Administrator\AppData\Local\Temp\oncihdiw.xg4:83:19)
    at __webpack_require__ (C:\Users\Administrator\AppData\Local\Temp\oncihdiw.xg4:20:30)
    at createWebpackDevServer (C:\Users\Administrator\AppData\Local\Temp\oncihdiw.xg4:62:26)
    at C:\Users\Administrator\AppData\Local\Temp\bmypasau.l3q:114:19
    at IncomingMessage.<anonymous> (C:\Users\Administrator\AppData\Local\Temp\bmypasau.l3q:133:38)
    at emitNone (events.js:106:13)
Current directory is: C:\Data\Repos
   at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.<InvokeExportAsync>d__7`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.<InvokeExportAsync>d__13`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__10`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__10`1.MoveNext(

@alexbenitez
Copy link
Author

OK it works if opening the /Server folder with VS (instead of the parent) so the project file is located under the project folder (and the wwwroot is still .. .I guess I'll keep two VS Code instances.

Probably this issue can be closed.

@tjaskula
Copy link
Collaborator

Thanks @alexbenitez for your insight. I'll look into the issue to see if this can be done without the need to have two instances opend

@tjaskula tjaskula added the enhancement New feature or request label Sep 18, 2018
@ctrlbru
Copy link

ctrlbru commented Oct 15, 2018

Hi, I think it's just an issue with launch.json:

"cwd": "${workspaceFolder}"

should be

"cwd": "${workspaceFolder}/server"

This fixes it for me with one single instance.

I also had to manually run webpack --config webpack.config.vendor.js in the server folder, but maybe that's me, I'm a beginner with webpack so I'm not sure how it should work. I kinda think's that's a different matter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants