views:

19

answers:

1

Is it possible to invoke cl.exe, the MSVC++ compiler, from inside a Visual Studio extension? I'm using VS2010 and not bothered about maintaining compatibility for 2008/2005. I've hunted through MSDN and had a poke through my DTE object, but not found anything of use. The documentation on what you can do with this stuff is kinda sparse.

A: 

I agree that the documentation for VSX can be confusing. I'm a bit unclear about what you're trying to do, are you trying to execute cl.exe directly, or do you just want to compile the current project/solution?

If you're just looking to build the current solution, from an Add-In you can do something like this:

_applicationObject.Solution.SolutionBuild.Build()

Let me know if I misunderstood your question.

Matt
What I wanted to do was skip MSBuild directly as it has a large amount of fat (and hidden objects) that I don't need, and just invoke cl.exe directly with given filepaths or string sources. I found the cl.exe task, but because it's built to use from MSBuild, I couldn't get it to work. You can invoke cl.exe from the command line, but only the Visual Studio command line, not the normal command line.
DeadMG