How to select debug profile in Visual Studio? - visual-studio

I have a .NET Core 3 (not ASP) project in Visual Studio 2019 that has two different launch profiles:
But whenever I launch my project, it always uses the first profile, even if I have the second profile selected in my project settings. How do I tell Visual Studio to actually use the other launch profile?
EDIT: This is what my toolbar looks like:
I have no dropdown to select a launch configuration. I found the "Start Debug Target" command and can add that to my toolbar, but it doesn't have a dropdown either, it looks just like the regular start button.

In projects you can configure the profile, not select it.
In order to select a profile you should choose it from dropdown list next to start button:
EDIT
On my VS the button is called Debug Target and is placed under Standard section in toolbar.
However, there's something fishy about this button in visual studio. When I removed button from visual studio I couldn't find it among other commands to readd it. After some googling I even found out there were problems with this in past.
https://developercommunity.visualstudio.com/content/problem/323626/if-you-remove-debug-target-from-toolbar-you-can-ne.html
Ewentually I found out two ways to bring it back.
Reset the standard toolbar
Add it from Add or remove buttons section next to standard toolbar

Related

Shortcut button for remote debugging in Visual Studio

I want to add a shortcut-button in Visual Studio 2015. Clicking this button should just emulate "Attach To Process" -> Select "w3wp.exe" -> Attach.
Does anyone know how to do it?
You can't do those two commands on one toolbar button click apart from creating or using an existing Visual Studio extension.
Creating a Visual Studio extension would be feasible but somewhat involved (as a complete project in itself).
Available Extensions:
The first extension you could use is Visual Commander (detailed below) to create a Macro.
Depending on your needs you could also use AttachTo which provide a one click option to attach to IIS.
Finally there is also Debug Attach Manager which can attach to specific process and then remember it.
Using a macro to achieve the desired effect:
As mentioned by #Sergey Vlasov, you can can install a Visual Studio Extension named Visual Commander that brings back Macros in Visual Studio. Then you can program a macro to do this for you. The code for the macro comes from another SO answer
Public Sub AttachShortcut()
For Each proc In DTE.Debugger.LocalProcesses
If proc.Name = "what you're looking for" Then
proc.Attach()
Exit Sub
End IF
Next
End Sub
Adding the shortcut button:
You can also easily add a button in your toolbar to add "Attach to Process..." if you prefer to have the button on your toolbar.
To do this go in the Menu under TOOLS. Then choose Customize.
There select the second tab "Commands".
The select Toolbar and choose the toolbar you want the button to appear in. For example "Debug" if you want it to appear during debugging.
Then press the Add Command... button and choose the Debug category. There you will find the Attach to Process.
This would make it more readily available if you prefer to use the toolbar.

Toolbox containing no items when I'm editing a dialog

I'm maintainig an old MFC application with Visual Studio 2013. Building the application works fine, but I'm unable to use the dialog editor.
When I open a dialog from the resource view, it displays correctly, I can click on the existing items, view their properties, move them etc.
But when I open the toolbox via the View-Toolbox command (Ctrl+Alt+X), all I get is an empty toolbox as displayed below:
Right click on the toolbar and "Reset Toolbox" doesn't change anything
Right click and then "Show all" shows an impressive list of tools, among those there is the Dialog Editor, but all items are inactive as shown in the picture below:
On the other hand when I create a new MFC project from scratch, the toolbox containing the dialog items works fine.
Does anybody have an idea what could be wrong?
FYI: in the meantime I use Visual Studio 6 (yes) for editing the resources.
There are two typical work arounds to get the toolbox back in Visual Studio. One is to reset the toolbox as you've tried. The other is to delete the “.tbd” files in your corresponding C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\12.0 folder.

How to reset the context menu in VisualStudio to have default items?

Am using VisualStudio 2013, update2. I am facing the below issue when I opened a project in VisualStudio today, I noticed on right clicking a project in the SolutionExplorer the context menu have a lot of options that even have scrolling now. Now I have to scroll down everytime to build or clean a project.
Earlier it was like a short menu like below.
I have not changed any settings but don't know why am facing this issue. I tried to customize the context menu command and chose (Project and solution context menus | Project) from the drop down, but that didn't worked out as it is automatically reset to tfs on clicking the close button. Does any one have idea about how to rectify this?
Note: The context menu has changed only for the projects inside the solution. On right clicking the solution name in solution explorer, I am still getting the same old menu.
From looking at your context menu screenshot, it looks like you have some extensions installed that have introduced these commands. Try disabling some or all of them in Tools > Extensions and Updates Manager to see which ones belong to which extension. There unfortunately isn't a way right now to customize this context menu.
Thanks,
Cathy
Visual Studio IDE Team

Solution Configurations drop down list in WP7

I'm running Microsoft Visual Studio 2010 Express for Windows Phone. My problem is I'm not getting the solution configurations drop down list.I tried a lot but I'm not getting it.
Click the Tools menu, click Settings, and then click Expert Settings.
The Solution Configuration list box appears in the Standard toolbar. Click Debug or Release.
If still not visible, check this

Blame source file from within visual studio

I'm using AnkSVN within Visual Studio 2010, and it covers ~95% of my SVN needs. The biggest missing feature is that I can't find a way to blame a file from directly within VS. The workaround I currently use is to right click on the file within the tablist, and select Open Containing Folder, and then right clicking on the file in Explorer to call Blame.
It's called Annotate in AnhkSVN.
Subversion -> Annotate in the context menu.
I didn't like AnkhSVN's Annotate feature. So I used the following:How to integrate TortoiseSVN into Visual Studio.
Content from above url:
If you're using Visual Studio, you can integrate TortoiseSVN commands to various context menus.
The first step is to add the TortoiseSVN commands as external tools, under the menu TOOLS->External Tools....
Add the name of the command, the path to TortoiseProc.exe and then the parameters for the command.
Use the VS variables wherever needed. Since I add my commands to the context menu of the open file tab, here's the parameters I used:
/command:blame /path:"$(ItemPath)" /line:$(CurLine)
/command:diff /path:"$(ItemPath)"
/command:log /path:"$(ItemPath)"
Notice the /line: parameter: this will make TortoiseBlame automatically scroll to the same line the cursor is located in the opened file in Visual Studio.
Now to add those new commands to the file tab context menu, go to TOOLS->Customize..., select the Commands tab, click the radio button Context menu and then select Other Context Menus | Easy MDI Document Window.
Now you have to select the commands. Problem is that the custom commands are not shown with their title but only as External Command X with X being the number of the external command.
In my case, the commands were number 9-11, you might have to do some trial-and-error here. Just add the commands you think are the ones you added and then check if the right ones show up in the context menu.
NOTE: In Visual Studio 2010 to add a command to the right-click menu of a document’s tab, first you’ll need to right-click on a Visual Studio document tab to work around a Visual Studio bug. (Otherwise the Easy MDI Document Window context menu doesn’t show up in the Customize dialog.) Source

Resources