Skip to content
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

VS Code doesn't create tasks/launch.json for projects published from VS Docker Tools #336

Closed
rajkumar42 opened this issue May 17, 2016 · 16 comments

Comments

@rajkumar42
Copy link
Contributor

  1. Install Web tools extensions
  2. Open VS. Create new project VIsual C# -> .NET Core -> ASP.NET Core Web Application (.NET Core).
  3. Open the project location in VSCode.

VSCode does not create tasks.json and launch.json files. The project could not be built or launched.

@chuckries
Copy link
Contributor

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.

@DustinCampbell
Copy link
Member

@chuckries is 100% correct

@rajkumar42
Copy link
Contributor Author

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?

@chuckries
Copy link
Contributor

chuckries commented May 18, 2016

<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.

@rajkumar42
Copy link
Contributor Author

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.

@chuckries
Copy link
Contributor

Does docker alter the project.json at all?

@rajkumar42
Copy link
Contributor Author

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.

@gregg-miskelly gregg-miskelly changed the title When opening web projects created in VS, VSCode does not generate tasks.json and launch.json VS Code doesn't create tasks/launch.json for projects published from VS Docker Tools May 18, 2016
@gregg-miskelly
Copy link
Contributor

@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?

@DustinCampbell
Copy link
Member

#310 will certainly alleviate the problem. It might not be perfect though.

@gregg-miskelly
Copy link
Contributor

@NCarlsonMSFT @SteveLasker is it a requirement that the Docker tools extension copies the project.json file into bin?

@chuckries
Copy link
Contributor

@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.

@gregg-miskelly
Copy link
Contributor

I see. Maybe we can delete the file when we are done restoring?

@NCarlsonMSFT
Copy link

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?

@chuckries
Copy link
Contributor

I can modify GetClrDbg.sh to delete its project.json after successful install if we think that is best.

@chuckries
Copy link
Contributor

chuckries commented May 18, 2016

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.

@gregg-miskelly
Copy link
Contributor

This is being fixed with microsoft/MIEngine#332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants