visual-studio-extensions

How can an Empty Visual C++ project be created programmatically?

南笙酒味 提交于 2019-12-10 10:59:19
问题 I wanted to know how to use the template for an Empty Visual C++ project to programmatically create a new solution with this empty project. The code (C#) I have right now is: string VSProgID = "VisualStudio.Solution.10.0"; Type solnObjType = System.Type.GetTypeFromProgID(VSProgID, true); Solution4 soln = (Solution4) System.Activator.CreateInstance(solnObjType, true); soln.Create(@"C:\NewSoln", "New"); soln.SaveAs(@"C:\NewSoln\New.sln"); string emptyVCProjPath = soln.GetProjectTemplate(

Visual Studio Extension: Access VS Options from arbitrary DLL

喜夏-厌秋 提交于 2019-12-10 10:46:19
问题 I'm currently developing my first VS extension, which needs to provide some options to the user. Following https://msdn.microsoft.com/en-us/library/bb166195.aspx, it was rather easy to come up with my own options page. However, I have not yet found out how to read my options. The solution structure of my extension is as follows: MySolution MyProject (generates a DLL from C# code) MyProjectVSIX Following the tutorial cited above, I have added a VS Package to my VSIX project and configured it

Visual Studio Extension (VSPackage) runs in all Experimental Instances, but does not run after being installed as a .vsix, except in VS2010

拥有回忆 提交于 2019-12-10 05:30:39
问题 I am writing a Visual Studio extension which targets VS2010, VS2012, and VS2013. It runs and is initialized successfully in each Experimental Instance with no issues. When I install the VSIX generated by the build, it installs in all versions without a problem, but only in VS2010 does it actually execute. In the others it's never instantiated or initialized. There are no exceptions being thrown. Running the non-Experimental instance with the /log flag does not produce any other diagnostic

Debugging Exceptions thrown by Visual Studio Extension

吃可爱长大的小学妹 提交于 2019-12-10 05:26:35
问题 I'm running Visual Studio 2015 with some extensions. I'm trying to debug the following error I'm getting: The errors are logged in ActivityLog.xml : 440 ERROR A MEF Component threw an exception at runtime: System.InvalidCastException: Unable to cast object of type 'System.Reflection.RuntimeMethodInfo' to type 'System.Reflection.ConstructorInfo'. at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.Resolve(ConstructorRef constructorRef) at Microsoft.VisualStudio.Composition

How to include debugging symbols to .vsix package

≯℡__Kan透↙ 提交于 2019-12-10 03:59:39
问题 I have written visual studio extension for private use. The package is still under development but I would like to use it and distribute it to my colleagues. Is it possible to include debugging symbols (.pdb) to .vsix package? I prefer a Visual Studio or Project setting to the package editing. 回答1: There's no setting for it within the VS UI, but you can edit your .csproj or .vbproj file to change it. If you open the .csproj file in notepad, either update or add this under a <PropertyGroup>

In a Visual Studio Extension, how to detect when the debugger Continues

萝らか妹 提交于 2019-12-09 11:12:25
问题 I need my Visual Studio extension to react to debugging events. I've registered a IDebugEventCallback2 and I'm receiving events, but all I get for each event is an opaque IDebugEvent2 and a Guid, many of which are not only undocumented but don't appear anywhere on the web (or in my registry). My specific requirement at the moment is to know when the process is Continued - ie. the user has hit Continue, Run to cursor, etc. What Guid should I be looking for? Or is there some other event family

Visual Studio 2012 is unresponsive at start with hidden error messages (two dings at start)

半城伤御伤魂 提交于 2019-12-09 08:18:16
问题 After latest update of Azure tools, Visual Studio 2012 does not work correctly. Looks like an unresponsive application, loading project very long, menu does not work too and you can hear two dings at start (like error message boxes, but there is no visible messages). In the some cases you can see the real message about "The HDIProjectPackage did not load correctly". At the same time Visual Studio 2013 is not affected. You can launch Visual Studio 2012 in the safe mode: C:\Program Files (x86)

Roslyn load project documents failing

 ̄綄美尐妖づ 提交于 2019-12-08 17:28:43
问题 In a Visual Studio Extension (VSIX) solution, I'm using Roslyn to load a specific project from my current solution: Project myProject = this.CurrentComponentModel.GetService<VisualStudioWorkspace>() .CurrentSolution.Projects .FirstOrDefault(p => p.Name == "MyProject") The projct myProject is definitely loaded, but on inspection I see that: myProject.HasDocuments == false myProject.Documents is Empty And yet, in Visual Studio I can see loads of documents. If I close the solution and open the

Is there a way within Visual Studio to easily get qualified type names?

喜你入骨 提交于 2019-12-08 15:47:17
问题 I'm looking for an extension/process for getting an object's assembly qualified type name within Visual Studio. I'm aware that you can write a quick console app to output this but find it to be a clumsy process. Ideally, I'd like the ability to right-click on a type name, and have the option to copy it's assembly qualified name to the clipboard in order to paste into my DI Container's configuration file. 回答1: In newer versions of ReSharper you can use the ReSharper/Edit/Copy Fully-qualified

How to Install WiX Extensions for VS 2017

别来无恙 提交于 2019-12-08 11:15:05
问题 I am new to Visual Studio 2017 Professional, and am trying to replicate my Vs2013 development environment including the installation of WiX extensions. Unfortunately when I attempt to install the Votive2017.vsix file I get an error message: Can someone please assist. I have been struggling with this for the last three hours now, and it is driving me insane. My VS2017 install seems to be complete, sufficient at any rate to compile, run and debug the VS solution that I have ported over from