Sunday, July 22, 2018

Multiple project files in tasks.json for .net Core?

I'm new to .net Core and I'm doing the course on Pluralsight called "Getting Started with .NET Core on Mac and Linux". In module 4 we're setting up our example program in VS Code to have both an app that can run on command and a service which is constantly running, both of which are separate projects but share a common library file.

The problem I'm having is getting launch.json & tasks.json set up to handle the two separate build events and the example given in the lesson does not work for me, possibly because the instructor is on an older version of .net Core? He's on 0.1.0 and the tasks.json file that was generated in my project looks different than his.

We added a second entry to launch.json for the service project, and now my launch.json looks like this - https://i.imgur.com/ZORNFyI.png

But I think the problem is happening in tasks.json. The instructor's solution on how to modify tasks.json was to remove the path to the .csproj file from the task args and instead add the option: "cwd": "${fileDirname}", and now my tasks.json looks like this - https://i.imgur.com/6U0depo.png

He explains in the video that this is a workaround so that whichever file is active is the one that will be built, but when i run this i'm getting the error "The preLaunchTask 'build' terminated with exit code 129." I've tried googling this error message, I've tried removing the cwd option and just adding a second build task that links to the second .csproj, but I still haven't been able to get it to work and I'm feeling stuck. Any suggestions?

Thanks in advance.

Multiple project files in tasks.json for .net Core? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team