Visual Studio Add-in Exec running Automatically - visual-studio

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!

Related

How to extend CodeLens

I'm currently writing a tool to help maintain unit and integration tests (coded tests). I've started extending Visual Studio to make the developer experience nicer, which got me to notice the new-ish CodeLens feature.
The stuff I'm currently showing as a tooltip should probably actually be part of the CodeLens info.
Question: Does anyone know how to extend CodeLens in Visual Studio?
Thanks.
As #RichardBanks says, officially CodeLens is not extensible. Technically I think it may be possible at the moment. Look for *CodeSense*.dll in the visual studio directory for hints. There is no documentation at present and the API can still change going forward.
I suggest you'd venture into this for research purpose only, distributing any 'plugin' seems like a very bad idea until Microsoft opens up the API, which they probably will.
CodeLens is officially extensible since Visual Studio 2019 was released.
CodeLens for Everyone
CodeLens has been a feature found only in Visual Studio Enterprise, but that will change in an upcoming preview of Visual Studio 2019, when it will also be available for the Community edition, likely in 2019. CodeLens shows the number of references a type or method has, information about unit tests covering the method, and data directly from Application Insights.
In addition, Microsoft has made CodeLens fully extensible1, so third-party extensions can start to add their own experiences on top of it. CodeLens makes key information about your types easy to find, while keeping you in the source code. Lenses for source control history and IntelliTrace are still an Enterprise-only feature.
Looks like this is the best place to start looking at when implementing your own CodeLens extension.
1. Highlight mine.
Code Lens is not currently extensible.
I can't say for sure, but I think there are still some features the team wants to add before they open it up for extension (e.g. git support).

Visual Studio 2010 for UI wireframe?

Just wanted to know that how good is the Visual Studio 2010 for designing UI wireframe?
Is there any major shortcoming in VS2010 in this area.
The UI that i am going to create are the mock up UI but i intend to use the same in future for actual web application development.
Please help, as i am going to use it for the above mention work .
I would rather use visio or any other Mockup tool, see here: http://webdesignledger.com/inspiration/18-great-examples-of-sketched-ui-wireframes-and-mockups
I don't think Visual Studio alone without any AddIn would be very useful in this.
If you want a microsoft product why not use sketchflow http://www.microsoft.com/expression/products/Sketchflow_Overview.aspx
AS you may already have blend installed.
I've started using the Balsamiq mock-up tool for quick prototypes, it's good for that early mock-screen stage but it might be too simple for what you want.
http://balsamiq.com/
There is a web-demo you can try, my favourite feature about it is that it doesn't look like a finished product so it keeps things looking suitably "prototypey". I've tried sketchflow after watching the incredible demo video but it was much buggier and unreliable when I tried it for myself and I spent more time fighting with it than I did coding so I just ditched it and went back to the Balsamiq tool.

Extending the extension manager

I want to extend the extension manager in Visual Studio 2010. I'd rather know if that is at all possible before I get into it, but am unable to find anything about it.
All the extensibility options I've read about mention nothing about being able to actually change the function of an existing VS2010 tool like the extension manager.
I'd appreciate any relevant links.
There are no supported interfaces for extending the Extension Manager in Visual Studio 2010.
What specifically did you have in mind though? Perhaps there's some other way you can accomplish what you're trying to do...

Replacing/Extending Visual Studio's Generate Stub in Visual Studio 2010

When we write the name of a method that doesn't exist, Visual Studio 2010 asks us if we'd like to generate a method stub with that name. What I'd like to know if is it possible to replace that same code stub generating command with one made by myself. I never did any kind of extensibility programming for Visual Studio so I have a couple of questions:
How hard is it? Is it something I can learn in a couple of nights, or is it something that'll make me "lose" a lot of time?
It seems to me that there isn't a lot of support for that kind of programming, as generally people are not that interested in developing solutions that extend the Visual Studio IDE. I searched on SO and it doesn't appear to have many threads about extending Visual Studio.
I don't know how the generate method stub thing works in Visual Studio, but I just wanted to turn it into something a bit more flexible and useful. Has anyone dealt with these kind of things before, that can give me a pointer to where to start? I know of MS VSX site but that has a lot of resources and can be overwhelming for someone new to the subject as I am.
What technology will I need to use? T4? Maybe I'll need to know a lot about the code, like Visual Studio does, so I can know other method's type arguments, names, etc. Is that what T4 is for?
Thanks
I searched the web a bit and I don't see anything about customizing the "Suggested Fix." Your thought in #2 is probably spot-on.
You can modify the VS editor by reading through http://msdn.microsoft.com/en-us/library/dd885242.aspx.

Which features & shortcuts for Visual Studio 2008 I might be missing, and how can I find out?

I recently got a job working for a company who uses several programming languages but mainly focuses on C#, and thus uses Visual Studio 2008.
As lame as it sounds, I don't know how to use it productively. I don't know any of the keyboard shortcuts, I didn't know you could restrict builds to certain parts of a solution until someone showed me. I'm sure there's a way to "Clean" "Build" "Run" without manually initiating each process, but I don't know what it is.
If it was just a "Search the help" problem, that'd be easy to solve, but I don't even know what I might be missing. Is there a productivity feature that everyone else uses and I don't? {Shrug}
So, what simple features of Visual Studio am I likely to be missing, and how can I find out other power-features to help me become more productive?
You can learn tons from walkthroughs, like the File/New/NerdDinner talk that Scott Hanselman gave at Mix 2009. The talk is online here:
http://videos.visitmix.com/MIX09/T49F
Until I saw that talk I didn't realize that you could just drag a SQL Server data file into the Visual Studio APP_DATA folder, and it would automatically hook it up for you. A copy of the data file also goes along for the ride when you build your application.
There are several books that just talk about Visual Studio and how to use it productively. Here are some:
http://msdn.microsoft.com/en-us/vstudio/dd285474.aspx
The problem with providing tips in an online forum like this one is that it can be difficult to "connect the dots." The walkthroughs are really good because you can see where things are in Visual Studio, and what sequences of steps are required to perform common actions.
Sara Ford wrote the book on VS tips and tricks:
http://www.amazon.com/Microsoft%C2%AE-Visual-Studio%C2%AE-Tips-PRO-Developer/dp/0735626405/
Here is a blog post with 24 of Sara Ford's tips
http://blogs.msdn.com/saraford/archive/2009/05/28/devdays-09-24-visual-studio-tips.aspx/
I also recommend James Avery's book:
http://www.amazon.com/Visual-Studio-Hacks-Tools-Turbocharging/dp/0596008473
I hope this helps.
As a start here is a poster which shows all the keyboard shortcuts for commonly used features of VS2008 (in C# mode).
In terms of tooling, ReSharper has a number of good features for improving productivity within VS2008.

Resources