vsx

Accessing the project system from a Visual Studio MEF Editor extension

I'm writing a Visual Studio editor extension using the VS 2010 SDK RC. I'd like to be able to figure out what the references of the current project are. How do I get access to the project corresponding to the current editor? The documentation on editor extensions doesn't seem to include information on how to access non-editor parts of...

How do I make Visual Studio automatically go to the first error in a build?

This is done manually by going to the "Error List" output window and double-clicking on the first error or pressing F8. Is there a way to automate this? (I'm using C++ if that matters.) ...

EnvDTE: ArgumentException when accessing the ActiveConfiguration

I'm writing an addin for Visual Studio 2008. At some point in my code, I'm attempting to access the current active configuration for a project: var configName = _Project.ConfigurationManager.ActiveConfiguration.ConfigurationName; Sometimes, in some very obscure cases, the getter for ActiveConfiguration throws an ArgumentException. Not...

persist vsx package settings in project configuration file

I developped a Visual Studio 2008 package that adds some menu/commands to the IDE. I have settings related to this package that I would like to save for each VS project where I use the package. How do I get the current selected project (assuming I have either a solution with several projects) using DTE2 methods. How do I programmatica...

What are the ramifications of using System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(path)) in T4?

System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(path)) So this is a work around to not being able to use T4 to reflect or read other files in the project or solution without locking the binaries from this post. The comments imply a memory issue. The comments talk about a no-unloading downside, would this be garbage collect...

Visual studio: automatically update C++ cpp/header file when the other is changed?

For example, if I change the signature in a function in either the header or the cpp, I'd like it to automatically change in the other one. If I add a new function in either, it should appear in both. If I delete a function, it could probably comment out the other one. Manually having to duplicate one's changes seems silly. Some people ...

Visual Studio Package for 2005/2008/2010 ??

We are looking to turn an internal tool we have developed into a Visual Studio Package that we would sell to other developers. The tool will impact the custom editor and/or custom languages. Visual Studio 2010 has redesigned the API's heavily to simplify much of the work involved for these types of integration but the key question we hav...

PLKs and Web Service Software Factory

We found a bug in Web Service Software Factory a description can be found here. There has been no updates on it so we decided to download the code and fix it ourself. Very simple bug and we patched it with maybe 3 lines of code. However* we have now tried to repackage it and use it and are finding that this is seemingly an impossible ...

Using vsx how do you create a sub menu with commands?

I have created the following vsct file xml. <?xml version="1.0" encoding="utf-8"?> <CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; <Extern href="stdidcmd.h"/> <Extern href="vsshlids.h"/> <Extern href="msobtnid.h"/> <Commands package="...

IntelliSense based snippet handling with Visual Studio 2010 SDK MEF Based text editor

Using the new Visual Studio 2010 SDK developing against the MEF based editor structure there's a question: How can I use the MEF editor interfaces to handle snippet behavior in IntelliSense? The ICompletionSession itself is not a problem (e.g. get the available snippets) rather filling the snippet, handling the subsequently expected act...

Within a Visual Studio 2008 Add-In, how can I tell which interfaces a class' property implements?

In a Visual Studio Add-In, I'm enumerating over the members of a class in the current source file. When I encounter a property (e.g. CodeElement.Kind == vsCMElement.vsCMElementProperty) I cast that CodeElement to a CodeProperty and I can see the property's name and type. What I'm having a problem with is getting a list of the propert...

How to create a VS2010 extension that uses Language Services

Creating extensions got much easier with Vs2010, but this seems not to be the case for everything... My aim: I wnat to make method calls and property uses of STATIC classes ITALIC. (Just like Eclipse and Java) I think I need to talk to the C# Language Service for this information, but searching for "Language Service" just yields result...

Suppress "No Source Available" pane in 2010

Arg! I have a custom "harness" executable running my class library project. Every time I step into the harness's code, I get that "No Source Available" pane popping up. As I know there is no source available, and that this is completely expected, I don't want this very intrusive and useless pane popping up every time. How can I suppr...

Visual C++ 2010 Express: extension SDK available?

Allegedly, Visual C++ 2010 Express, unlike previous versions, supports third party extensions. I just downloaded the release candidate SDK for Visual Studio 2010, but the installer fails saying that I don't have Visual Studio installed (which is true since i use Visual C++ 2010 Express). Have I missed something? Is there a version of th...

Get methods covered by a unit test

Is is possible to do the following from a Visual Studio 2010 plugin? If yes, how? Run all unittests in solution (with code coverage enabled) Wait for all tests to complete For successfully completed tests: Determine which methods were called during each test (directly by the test or indirectly by the tested methods). And store their na...

Is it possible to extend the WPF design surface in 2010?

I've got an idea for a nice WPF designer extension, but I can't find any information on how to interact with the WPF designer via an extension. Lots of info about the text editor, but none about the WPF designer. Important note: I'm looking to do this through an extension, like you'd download from the Visual Studio Gallery, rather tha...

How to deploy and register a VSPackage supporting multiple versions of Visual Studio (2005, 2008, 2010)?

I have an open source VSPackage that I would like to release with support for Visual Studio 2005, Visual Studio 2008, and Visual Studio 2010. I'm trying to figure out how to create the installer and how to perform the package registration with each edition of Visual Studio. The deployment research I've done indicates my best bet for an...

How can I listen for the deletion of a ProjectItem via DTE?

I've got a designer that relies on the existence of other solution items. If one of those items is deleted the designer crashes and you have to edit as XML to fix. Not exactly user friendly. I do, however, have the DTE object representing the instance of Visual Studio, as well as the ProjectItems I am dependent on. Is it possible to,...

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 ...

Controlling CodeModel's code output formatting: putting lines between namespace declarations

I'm making some experiments with Visual Studio's CodeModel. I tried creating a file with two namespaces in there through VS's Code Model: CodeModel codeModel = projItem.ContainingProject.CodeModel; codeModel.AddNamespace("Namespaces.FirstNamespace", "namespacestest.cs"); codeModel.AddNamespace("Namespaces.SecondNamespace", "namespaceste...