Visual Studio 2010 Macro - Reporting Progress - visual-studio-2010

I have just discovered macros in Visual Studio and I can't be happier. Well... I have my complaints but... you know ;)
A few of my macros are taking quite a while to complete and I am looking for a way to track progress. I build a log file during most of my macro processes but I have not found a good way to report progress without pausing the process. Ex. MsgBox("Progress")
Any way to access the output window or even better the VS status bar?

I made a macro for Visual Studio 2005 which needed a form to choose between some options. I made that form from code and everything worked fine.
I think that you can do something similar. You can create a form with a progress bar and use that to track your progresses.

You could also use the visual studio designer to generate the code for you.

Related

Integrating the Blend design into Visual Studio 2010

I am a student & am newly introduced to the Microsoft Blend.
Its something really impressive & makes me design happily.
But I am facing a problem: Its fine about the designing part but what about the coding?
Where are we suppose to write the code? I mean how are we to import that file into Visual Studio 2010.
Please do tell me the solution ? I have been looking out for resources nearly everyday.
But its still in vague.
Thanking you.
Expression Blend is a tool meant for designers so it does not really focus much on features for writing code. It is actually designed to inter-operate well with Visual Studio and you should be able to just open any Blend project or solution in Visual Studio and do your coding there.
In fact, I often have both tools open at the same time with the same project open and it makes for a pretty smooth workflow. For example, if I make a change in Blend and then switch to Visual Studio it will prompt me to reload the changes.
If you have Visual Studio installed the easiest way is to click on a file inside the Projects tab and then choose Edit in Visual Studio (see image). Once you do that VS will load the project / solution and open the file for you to edit your file and or add code to it.

int number; number.m_value?

Today my Visual studio couldn't help me by auto complete so I thought that the ReSharper trial period had ended .After I suspended ReSharper I see that still no auto complete. After a few changes I see still the same problem and there are some strange behavior in Visual Studio. For example I see m_value field for int. But my other Visual studio instances works as expected. How can I fix this problem?
Probably there is an error somewhere in your code which is causing the types to be determined incorrectly - for example a missing curly brace. Check your code carefully for errors. Make sure that your code compiles correctly.
PS: You don't need ReSharper to get autocompletion. Intellisense is a standard feature of Visual Studio. Even without ReSharper I find the built-in autocompletion extremely usable.
IntelliSense is Microsoft's implementation of autocompletion, best known for its use in the Microsoft Visual Studio integrated development environment.
The file property build action was content and this was reason of those strange behaviours. It is fixed after turned build action to compile.

Visual Studio Add-in Exec running Automatically

Hey guys, I have a dilemma that I am uncertain about, as I not sure if it's is exactly possible for a Visual Studio Add-in to run its code automatically.
I need an add-in that can run passively, like a logger for Visual Studios. However, the Exec method that I know so far can only execute commandbar functionality, but I need the code to execute when the user right-clicks, or select a line of text.
I was able to make an automatic logger if i put my code in the "querystatus", but that would be considered bad programming, and it does not log when I simply select a piece of text.
Does anyone know how to make a passive or automatic running code in Visual Studios?
Unfortunately I think you may need to implement this as a VS Package, which is a much more powerful way to extend Visual Studio. I'd highly recommend looking at the MSDN documentation regarding the "Integration Architecture", it will give you a good idea about the VS extensibility model works and some of the concepts that it uses.
More specifically to your problem, it sounds like you want to extend the Visual Studio editor. There's quite a bit of documentation about extending the editor on MSDN.
Hope this helps!

Visual Studio IDE: I want it to make a sound after it compiles so I can get back to work

Would be a nice thing - do I have to write a script or can't I just tweak the build script to do some task?
Windows already has support for this, go to the Control Panel and open up Sounds and Audio Devices. Under the Sounds tab there is a section for program events. If you scroll down far enough one of the sections will be Microsoft Visual Studio. Then just pick the sound you want to hear for Build Succeeded and Build Failed. You will need to restart Visual Studio after choosing your sounds.
If you don't want to enable it for every single build, you can make an application that plays a sound, and add it into the post build event for that project.
I also wrote an extension for Visual Studio to achieve that. It also can play a sound when tests finished to run.
Visual Studio Ding extension

Visual Studio 2008 Plug-in / Add-in development - Getting Started

In relation to this stackoverflow question, how would I go about creating my own Visual Studio 2008 plug-in?
I've checked the Visual Studio Developer Centre on MSDN, but the amount of info is overwhelming. There are loads of project types, and I don't even know where to start.
Where should I start looking if I want to write something which meets the following requirements:
A plug-in that runs like a "service" in Visual Studio, and is able to poll Visual Studio for information, and handle Visual Studio events.
The info I'd like to access from VS are things like, what projects are currently open, who has them open, and other solution/project file based info.
The events I'd like to be able to handle are things like, the opening/closing/editing/creating/deleting of Solutions / Projects / individual files.
I'd also like to be able to handle any interaction with VS on a per solution basis. So, I'd like to handle any interaction with files, even code editing, but also, just other interaction, like with the menus, or just the IDE itself.
As well as these, I'd also like to be able to store data somewhere. Where is this usually done? Can I add Metadata to the Solution file? Or, does it make sense to save this info to a small local instance of a database, that is somehow attached to the solution..?
I just need a push in the right direction, is any of this possible? What part of the Visual Studio Developer Centre should I focus on? What APIs should I check out?
cheers!
An add-in can do most of that. There's a template in VS2008 for creating a base add-in.
I have an add-in that you can download that hooks into the solution/project load events etc - it is free and comes with source code ( http://www.huagati.com/projectloader/download/huagatiprojectloader.zip ). This particular add-in detects when projects/solutions are loaded and pre-loads referenced assemblies to work around a CLR bug that can cause VS2008 to crash. Anyway, the source code for it shows how to detect some of the events you're looking for.
Other than that, the definitive resource on add-in development and all the little quirks and tricks involved is Carlos Quintero's blog ( http://msmvps.com/blogs/carlosq/ ) and the "howto" article series on his website ( http://www.mztools.com/resources_vsnet_addins.aspx ).
Craig Skibo's blog ( http://blogs.msdn.com/craigskibo/ ) also has some useful tips.
You want:
Visual Studio Extensibility Developer Center
VSX Forum
Visual Studio 2008 SDK
Professional Visual Studio Extensibility by Keyvan Nayyeri
Buy the book, if nothing else.

Resources