Questions tagged [visual-studio-macros]

A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically. Macros allow you to automate repetitive actions. Visual Studio includes the Macros integrated development environment (IDE), which is used solely for creating, manipulating, editing, and running macros. The Macros IDE is separate from the Visual Studio IDE.

The Visual Studio Macros integrated development environment (IDE) has the same look and feel as the Visual Studio IDE, but is separate from it. The Macros IDE includes the Code Editor and several tool windows. These windows function the same as their Visual Studio counterparts, except that they apply specifically to the code and projects within the Macros environment.

209 questions
67
votes
14 answers

Awesome Visual Studio Macros

For a small community discussion, what are some essential Visual Studio macros you use? I just started learning about them, and want to hear what some of you can't live without.
BBetances
  • 925
  • 1
  • 14
  • 23
51
votes
10 answers

Alternative to macros in Visual Studio 2012

I use macros extensively for ViewModel properties in XAML development. I use them even more in WCF to generate Message and DataContract properties. To my disappointment, the macros I've built aren't going to be usable in Visual Studio 2012. An…
kfrosty
  • 805
  • 1
  • 8
  • 14
45
votes
10 answers

Toggle "Break when an exception is thrown." using macro or keyboard shortcut

Edit: Visual Studio 2015's new exception window is so much faster than the old dialog that I no longer care as much about using a keyboard shortcut for it. Is there a macro or keyboard shortcut that will toggle "break when an exception is…
dss539
  • 6,804
  • 2
  • 34
  • 64
33
votes
2 answers

Collapse all Visual Studio toolbox regions shortcut

Is there a keyboard shortcut or macro to collapse all regions in Visual Studio's toolbox? (Failing either of those, I'll take an addin that allows this!)
Sean Kearon
  • 10,987
  • 13
  • 77
  • 93
22
votes
1 answer

How to Use/Enable (RegExp object) Regular Expression using VBA (MACRO) in word

I did lot of Googling to get a proper answer on how to use or start using Regular Expressions in VBA. At last I got it so I'd like to share my knowledge with you guys. Please correct me if I am wrong.
Jerry James
  • 1,125
  • 1
  • 10
  • 17
15
votes
6 answers

Accessing Visual Studio macros from source code?

Visual Studio has macros like $(TargetDirectory), $(OutputPath) etc. In my source code, I want to specify a relative path for the loading of a file from a folder a few levels below the TargetDirectory. Currently I'm doing this: mLayer =…
Nav
  • 19,885
  • 27
  • 92
  • 135
14
votes
1 answer

Preprocessor macros as parameters to other macros

The following C++ code compiles and works as the programmer intended on GCC (4.0.4) #define FOO(x,y,z) ((x)*(y)*(z)) #define BAR(x) FOO(x,1) #define BAZ 3,7 int main() { return BAR(BAZ); /* interpreted as return ((3)*(7)*(1)); */ } However,…
otto
  • 1,138
  • 6
  • 14
13
votes
8 answers

Automatically Add Regions to Code in Visual Studio

My team absolutely loves using regions, and with that in mind it's pretty much become a de-facto standard in our code. I recently came to realization that I'm sick of writing or ctrl+c / ctrl+v'ing these in every time I create a class, test method,…
Eric Stallcup
  • 379
  • 2
  • 5
  • 15
11
votes
4 answers

How to get specific version of folder from tfs without creating a workspace?

I would like to get the source code of a project at specific time (changeset). So I need do download whole folder. I would like to do it for different times and handling a different workspace is not very convenient. I know about TFS Get Specific…
IvanH
  • 5,039
  • 14
  • 60
  • 81
10
votes
1 answer

Visual Studio 2012: How to perform a conditional post-build event

How do I perform a conditional post-build event? Specifically, I would like to only execute the post-build event command line for the debug release but not for the release build. I did not see any way in a project's properties' Build Event page.
9
votes
5 answers

Debug custom dll that is being referenced in visual studio macro

I previously asked: Add dll reference to visual studio macros the idea of creating the macros in my language (C#) makes it easier to create the macros. The problem is that I cannot debug the dll To solve the problem I have tried: I placed…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
8
votes
4 answers

Visual Studio macro: Find files that aren't included in the project?

I'd like to write a macro to crawl through the files in my project directory and find files that aren't included in the project. In playing around with the DTE object, I see that the Project object has ProjectItems; if a ProjectItem represents a…
Herb Caudill
  • 50,043
  • 39
  • 124
  • 173
7
votes
2 answers

Is there a better way to pass formatted output to OutputDebugString?

Typically, when I need to do debug output in Windows, I use the following C code segment: #ifdef _DEBUG #define DBGPRINT( kwszDebugFormatString, ... ) \ { \ wprintf_s( L"[%s:%d] ", __FUNCTIONW__, __LINE__ ); \ wprintf_s(…
7
votes
1 answer

How can I perform "Go To Definition" programmatically in Visual Studio?

Given a string that represents a specific class/field/property (eg MyNameSpace.MyClass or System.String.Length), how can I programmatically cause Visual Studio to go to that class/field/property (ie, make Visual Studio do the same thing that would…
Omer Raviv
  • 11,409
  • 5
  • 43
  • 82
6
votes
4 answers

How can I make a Visual Studio Macro to attach the debugger to all instances of w3wp.exe?

I'm normally developing web apps, and a surprisingly large amount of my work time is spent doing "Ctrl + Alt + P", sorting by Process Name, and picking w3wp.exe to attach my debugger. To make matters worse, I'm working on an app that spans several…
1
2 3
13 14