VS Code doesn't create tasks/launch.json for projects published from VS Docker Tools
- Install Web tools extensions
- Open VS. Create new project VIsual C# -> .NET Core -> ASP.NET Core Web Application (.NET Core).
- Open the project location in VSCode.
VSCode does not create tasks.json and launch.json files. The project could not be built or launched.
Are you opening the directory that actually contains the project.json? Or are you opening a directory that contains a src/<web app>/project.json? I think we only support adding these assets if project.json is on the workspace root.
@chuckries is 100% correct
I'm opening WebApplication1\src\WebApplication1 folder where project.json contains project.json. I've tried opening it under WebApplication1 as well.
What is the workspace root when I create a template project?
<workspace root> refers to root directory opened in VS Code. It looks like the root directory of the VS project template for .net core web app contains the project.json, which is where the project should be opened in VS Code.
Apparently this only reproduces on docker scenarios. Following are my repro steps Install Web tools extensions 2.Open VS. Create new project VIsual C# -> .NET Core -> ASP.NET Core Web Application (.NET Core). 3. Add docker support from VS. 4. Run the app on docker container. 5. Close VS. 6. Open the project workspace on VSCode.
Does docker alter the project.json at all?
Step (4) is the key. Looks like (4) produces a project.json in \WebApplication5\src\WebApplication5\bin
after deleting that VSCode can produce launch.json and tasks.json.
@DustinCampbell do we think the problem is that OmniSharp should be ignoring project.json's in the 'bin' directory? Or will the experience be good enough once #310 is fixed?
#310 will certainly alleviate the problem. It might not be perfect though.
@NCarlsonMSFT @SteveLasker is it a requirement that the Docker tools extension copies the project.json file into bin?
@gregg-miskelly The project.json in bin is the project.json for clrdbg that is pulled in by GetClrDbg.ps1. It is not a copy of the app's project.json. @rajkumar42 please correct me if I'm wrong.
I see. Maybe we can delete the file when we are done restoring?
Is that something you can take care of in the GetClrDbg scripts? Or do you need us to try and clean up in the scaffolded script from VS. If the later how can we determine what in the InstallPath folder is safe to delete?
I can modify GetClrDbg.sh to delete its project.json after successful install if we think that is best.
I also considered doing it this way originally: the script could generate project.json/nuget.config somewhere under %TEMPDIR% and publish to the correct output directory.
This is being fixed with https://github.com/Microsoft/MIEngine/pull/332