HttpRepl icon indicating copy to clipboard operation
HttpRepl copied to clipboard

How to Integrate into launchSettings.json

Open RehanSaeed opened this issue 6 years ago • 6 comments

What magic incantation do I need to add to the launchSettings.json file to add the HTTP REPL as an option to launch the app? I'd prefer this because it's not a manual thing that we have to do in Visual Studio, plus some developers might be using VS Code. I initially tried:

// The HTTP REPL must be installed.
// dotnet tool install -g Microsoft.dotnet-httprepl
"HTTP REPL": {
    "commandName": "Executable",
    "executablePath": "dotnet",
    "workingDirectory": "$(ProjectDir)",
    "commandLineArgs": "httprepl https://localhost:5001",
    "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
    }
}

However, this starts the REPL correctly but not the site itself. Is there a way to do both?

RehanSaeed avatar Aug 07 '19 14:08 RehanSaeed

cc @metoly @AngelosP I know the blog post had instructions for the launch.json file in VS Code, but are there similar instructions for launchsettings.json ?

tlmii avatar Aug 07 '19 21:08 tlmii

I am not aware of a way to do that yet. I know we have plans to do something in this space very soon.

AngelosP avatar Aug 08 '19 19:08 AngelosP

Hi, I can start the httprepl from visual studio on F5 (I followed the above mentioned blog), however, is there a way how to automatically run a script after the httprepl starts?

el-peregrino avatar Nov 03 '20 22:11 el-peregrino

@el-peregrino There is a way, but in VS it is limited to just one script regardless of which project you're working on. In the step where you set up httprepl as a "browser", you can put run "c:\path\to\script.txt" in the Arguments field and that will run automatically.

tlmii avatar Nov 03 '20 22:11 tlmii

@tlmii Thanks a lot. I was quite near to it. I can live with the limitation for now.

el-peregrino avatar Nov 03 '20 22:11 el-peregrino

I think this is a great idea, but we want to do better than this and just have it light up when you have it installed. As in, if you have the HttpRepl installed, it just "becomes" a browse target. This is the ideal scenario we'd like to unlock, and we have some work items on it.

cc @sayedihashimi @timheuer

bradygaster avatar Nov 12 '20 19:11 bradygaster