Delivered my session Power to the Virtual Agents at aMS Berlin
Today I had the pleasure to talk about Power Virtual Agents at aMS Berlin 2022. I got some very nice feedback at the end of the session from the audience who...
Quite a time waster…
In Visual studio/Visual Studio Code ususally things go way smoother when installing extra extensions/vs code extensions. For the above described annoyance I found quite a nice extension for Visual Studio: SwitchStartupProject for VS 2022.
Once installed the extension will add a new item in the toolbar of Visual Studio.
Hitting that Configure...
menu item will open up a json file like the following (for our demo project):
/*
This is a configuration file for the SwitchStartupProject Visual Studio Extension
See https://heptapod.host/thirteen/switchstartupproject/blob/branch/current/Configuration.md
*/
{
/* Configuration File Version */
"Version": 3,
/* Create an item in the dropdown list for each project in the solution? */
"ListAllProjects": true,
/*
Dictionary of named configurations with one or multiple startup projects
and optional parameters like command line arguments and working directory.
Example:
"MultiProjectConfigurations": {
"A + B (Ext)": {
"Projects": {
"MyProjectA": {},
"MyProjectB": {
"CommandLineArguments": "1234",
"WorkingDirectory": "%USERPROFILE%\\test",
"StartExternalProgram": "c:\\myprogram.exe"
}
}
},
"A + B": {
"Projects": {
"MyProjectA": {},
"MyProjectB": {
"CommandLineArguments": "",
"WorkingDirectory": "",
"StartProject": true
}
}
},
"D (Debug x86)": {
"Projects": {
"MyProjectD": {}
},
"SolutionConfiguration": "Debug",
"SolutionPlatform": "x86",
},
"D (Release x64)": {
"Projects": {
"MyProjectD": {}
},
"SolutionConfiguration": "Release",
"SolutionPlatform": "x64",
}
}
*/
"MultiProjectConfigurations": {}
}
The list already shows all the projects in our solution which is great. When we want to add a setup where we want to start the following applications we adjust the aforementioned json configuration file like this (left out the comments):
"MultiProjectConfigurations": {
"AllThreeApps": {
"Projects": {
"Console01": {},
"Console02": {},
"WebApplication01": {}
}
}
}
When you want to pass arguments you can change it like:
"MultiProjectConfigurations": {
"AllThreeApps": {
"Projects": {
"Console01": {},
"Console02": {
"CommandLineArguments": "https://www.krisvandermast.com/"
},
"WebApplication01": {}
}
}
}
When you save it you’ll see all of sudden the following appear in the solution:
Which holds the following json:
{
"profiles": {
"Console02": {
"commandName": "Project",
"commandLineArgs": "https://www.krisvandermast.com/"
}
}
}
I changed the code of Console02 app to the following to showcase the arguments:
Console.Title = "Console02 sample app";
Console.WriteLine(args[0]);
Console.Read();
And when running this (only took a screenshot of Console01 and Console02 here):
Leave a Comment