Attach to executable with Visual Studio debugger - visual-studio-2010

What I'd really like to do is debug an executable using the Visual Studio debugger. It comes with an Attach to Process feature. Unfortunately, the target executable only lasts for a short period- much too short for me to launch the executable and then navigate through Visual Studio and attach to it. How can I command Visual Studio to launch the executable and immediately attach the debugger?

AttachToLazy VS add-in can wait for a process to start and then attach to it.
This add-in was written for VS2008 and it looks like some people were able to get it to work with 2010 by adjusting some of the properties (info under the Discussions tab).

Related

Run an executable in WSL from a Visual Studio launch profile

In Visual Studio in Windows I can create a launchSettings.json profile which starts up an executable I specify and then attaches to it. Is it possible to do the same with an executable in WSL?
I'm writing an extension to a Linux program. The extension is a .Net 6 class library, so in order to debug it I need to start up the Linux program and then immediately attach. I could start up the program manually and then attach to the process from Visual Studio, but the extension loads first thing and I can't hop over to Visual Studio and attach fast enough to catch it.
I've found instructions for debugging .Net ASP and console apps in WSL from Visual Studio, but those instructions always assume that the project I'm debugging is itself executable.

How can I debug chromium in visual studio 2019?

Visual studio crashes while building all.sln. I have all the source files. Chrome.exe is also working fine. But, It's been a week, I am not able to build chromium from Visual Studio. It shows this error message.
Unable to start program* allocator_clang_newlib_x64. The system can not find the file specified.
The all.sln is a very big solution with all the Chromium source code as Visual C++ projects. It will make Visual Studio slow even on high end machine. So the recommended way to debug your Chromium fork is via a standalone Visual Studio project. You can follow the steps below:
Open Visual Studio command prompt
Navigate to your Chromium's src folder from that CLI
Open Visual Studio to debug your Chromium executable by typing the following devenv /DEBUGEXE "out\YourBuildFolder\chrome.exe"
Press F5 to start debugging your source code.
Tip: If you want to start debugging by stopping at the entry point, on Solution Explorer pane, right click that project and choose Debug -> Step into new instance from the context menu.
You can use all.sln to edit the source code and yes you have to compile it again for the changes to take effect.

Can't debug Visual Basic Scripts

I'm trying to debug a VBScript. I installed Visual Studio 2017 Community edition, but whenever I run my script (with a stop placed near the beginning of the script), the Just-in-Time debugger does not pop up and my scripts continues.
I've looked at the following, and nothing has helped:
Just-In-Time Debugging in Visual Studio
I've enabled it in Internet Properties.
I've enabled "Managed", "Native", and "Script" in Tools\Options\Debugging\Just-in-Time in Visual Studio 2017.
All the registry keys listed in the article are present in the registry.
I was able to follow the article C# Console App example. It did (although with variable success) eventually get into the debugger.
Visual Studio 2013 and VB Scripts
I tried debugging in the manner detailed here, but it never stopped at the stop or any of the breakpoints I set up.
The only thing I can think of is maybe the values in the registry are incorrect. The MSDN article didn't explicitly mention what the values should be.
Have other people tried using Visual Studio 2017 for debugging VBScripts? I've had luck using 2010 and 2012 at my work computer, but sadly I can't find downloads for those versions of Visual Studio for my home computer.
If anyone has any ideas, please let me know.
If you run your VS as the admin, and enable the Script debugging under TOOLS->Options->JIT debugging, how about the result?
I used the VS2017 Enterprise version before:
Visual Studio 2017 debugging vbscript
Or check the workaround in this feedback which is similar to this issue:
https://developercommunity.visualstudio.com/content/problem/30845/vs2017-script-jit-debugging-is-not-working.html

Command line to start visual studio and disable add ins/Extensions for that instance

I am writing a Visual Studio template wizard. And to debug it I have it start a new instance of Visual Studio 2010.
My Visual Studio 2010 takes a good while to start up. I believe that this is due the the add-ins and extensions that I have installed for visual studio.
I would rather not go disable them all (I really like them). So I was hoping there was a way to disable them via the command line.
Just run a clean Visual Studio instance.
Is there a way to do that?
Try safemode
devenv.exe /safemode
which
Starts Visual Studio in safe mode, and loads only the default environment and services, and shipped versions of third-party packages.
See http://msdn.microsoft.com/en-us/library/xee0c8y7.aspx

vsjitdebugger alternative?

vsjitdebugger gets more annoying when i switched to windows 7. :(
i'm a commandline person (vim, msbuild and vsjitdebugger) when developing .NET. I'm looking for a better vsjitdebugger alternative that automatically attaches the application to visual studio (or any application that is less annoying than vsjitdebugger.)
TIA :)
From here
To begin Just-In-Time debugging when
an error occurs
In the Just-In-Time Debugging dialog
box, in the Possible Debuggers list,
click New instance of Visual Studio
2010 or click an instance of Visual
Studio 2010 that is already running.
To use Visual Studio automatically for
all future crashes, click Set the
currently selected debugger as the
default.
If you want to choose what types of
code you will be able to debug, click
Manually choose the debugging engines.
If you do not choose this option,
Visual Studio automatically selects
the appropriate debug engines for the
type of code in your program.
Click OK.

Resources