The title pretty much says it all. I'm writing a visual studio extension in which i'm creating a custom command. In the callback of this command, i need to invoke the "solution level Build command" at some point in my logic. I found one GlobalInvoke(CommandID commandID) method present in OleMenuCommandService class. The CommandID takes two arguments "CommandID(Guid menuGroup, int commandID)". I could not find the Menu Group Guid for the Build Menu Group. Firstly, am i right in the above approach? If no, please guide me to the right approach. If yes, how can i find the Guids and IDs needed to invoke the Build command? Thanks in Advance.
How to invoke Solution level Build command present in Visual Studio in my custom command while creating a Visual Studio extension?
640 Views Asked by Atul Poddar At
2
There are 2 best solutions below
0
Ionut Enache
On
Also if you need to do something at the beginning/end of the build event you can do something like this to catch the event:
mDte.Events.BuildEvents.OnBuildBegin += OnBuildBegin;
mDte.Events.BuildEvents.OnBuildDone += OnBuildDone;
Or you can get the result of your build programmaticaly and check if the build succeed or failed. The exitCode will be 0 if the build succeed and different of 0 otherwise :
int exitCode = DTEObj.Solution.SolutionBuild.LastBuildInfo;
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in VSIX
- How to build Visual studio extension which install on top of an already installed extension
- In a VSIX package, how can I reuse the existing MEF for my dependency container?
- DirectX VSIX Installer Installation Failed
- In a Visual Studio Extension, how to detect when the debugger Continues
- In a Visual Studio Extension, get the line range of the function in which the debugger is stopped
- Adding a submenu to an existing menu in a Visual Studio 2013 extension
- How to tell Visual Studio to load only the extension I'm currently debugging (and nothing more)?
- The new project type and template does not show up after installing VSIX package
- VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products
- How to use newer Microsoft.CodeAnalysis reference in Roslyn analyzer targeting VS2015
- Creating VSIX package to install template to several project types?
- Get WPF control properties from the Properties Window
- How to access source code of a file from a Visual Studio Extension
- Visual Studio extension does not load in experimental instance
- How can I set a file name using a variable in a Visual Studio project template
Related Questions in VS-EXTENSIBILITY
- In a Visual Studio Extension, how to detect when the debugger Continues
- MPF Project : VS Package Build Event Not calling in VS 2012
- In a Visual Studio Extension, get the line range of the function in which the debugger is stopped
- Using built-in icons in Visual Studio extension
- Visual Studio Custom Project System
- How to export the pending Checkins in excel from isual studio 2010 - vs extension
- How to use the C# editor in a Visual Studio Isolated Shell application?
- Extend Visual Studio functionality for Installshield ISPROJ Project type
- Change VS option by using the Settings Store: finding the right CollectionPath?
- Visual Studio: Context Menu on Solution Explorer too long, can I add a sub menu or a toolbar above solution explorer?
- Visual Studio Extensibility / Margins
- Is it possible to customize the built-in Visual Studio 2010 C++ project wizards?
- Creating Visual Studio 2010 Add-Ins - how to start?
- How can I programmatically access Visual Studio 2013's Return Values that appear in the Autos Window?
- VS2019 addin/extensions How do enable/disable menu item
Related Questions in MPF
- MPF Project : VS Package Build Event Not calling in VS 2012
- Extend Visual Studio functionality for Installshield ISPROJ Project type
- Visual Studio 2010 MEF vs MPF?
- How do I subscribe to solution and project events from a VSPackage
- C# WPF Style: One Button Mouseover - One Button keep Image
- Is this a bug in mpf_class types?
- Async implementation of Custom Commands in VSIX
- Calls GetScanner but never uses it
- Modifying emularor/device list of visual studio 2013
- TypeError after trying to plot dataframe with mpf.plot
- How to invoke Solution level Build command present in Visual Studio in my custom command while creating a Visual Studio extension?
- Candlesticks in matplotlib
- Visual Studio 2010 Extensibility, MPF and language services
- Sprintf to concat string
- Managed Package Framework for Visual Studio 2017
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can call
DTE.ExecuteCommand("Build.BuildSolution").If you want to use guid and ID, see the following VB sample: