locked
VS command line: devenv.exe /command switch with mulitple commands RRS feed

  • Question

  • Hi!

    Is there any way to write complex commands after /command switch for devenv.exe? What I'd like to do is start IDE, build the solution with a specified SolutionConfiguration and run that. The /run switch is not appropriate for me cause I can't specify the Configuration, it uses the last active one. I'd like to do this with /command switch at once:

    Build.SolutionConfiguration Release/Debug
    Build.RebuildSolution

    Of course I could do that by writing a macro with those two commands and run that from command line but I feel it overheaded, I don't want to create a macro for only two commands. Is there a way to specify them in command line?

    Thx,
    Bela

    • Moved by Andrew.Wu Monday, March 14, 2011 6:33 AM (From:Visual Studio Setup and Installation)
    Thursday, March 3, 2011 9:45 AM

All replies

  • Hi Bela,

    According to your description, are you want to use the devenv switches to build the project?

    I find the below note in MSDN library:

    "For build-related tasks, it is now recommended that you use MSBuild instead of devenv. For more information, see MSBuild Command Line Reference." See: http://msdn.microsoft.com/en-us/library/xee0c8y7.aspx

    You might consider to use the MSBuild instead then.

    And the MSBuild forum is: http://social.msdn.microsoft.com/Forums/en-US/msbuild/threads

    I hope this help.

    Friday, March 4, 2011 10:13 AM
  • Yes, I found that too, but MSBuild isn't good for me.

    I'm working on a testtool for our application that runs on a remote computer and is able to update source, build and run project in VS while monitoring its state. The monitoring is done by a VS addin. I think I wasn't proper enough in my first note, but what I want to do is start IDE, build solution with a specified configuration and run that in IDE for debugging purpose. Therefore there are two problems with MSBUild:
    - It does not start IDE, it runs in a command line mode. We use VS2005 for developing our application and it can't load an addin in CL mode. I found that this was a bug in VS that has already been fixed. Although I installed the hotfix, I couldn't manage to start it in CL mode with an addin loaded.

    - The second problem is that MSBuild does only a build, but I need to start app after that. Though it can be done by calling devenv with /run switch, in that case I would loose build info between the two instance of VS. That's why I have to start IDE and monitor that continously.

    I think I'll write that macro.

    Tuesday, March 8, 2011 1:18 PM
  • Hi Bela Szabo,

    According to your description, I think you will need to wirte a batch file to accomplish your goal.

    For how to write the bat file, you can post your question in the MSBuild forum: http://social.msdn.microsoft.com/Forums/en-US/msbuild/threads, and consult experts in that forum.

    If you have any concerns, please feel free to let me know.

    Best Regards,


    Andrew Wu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 11, 2011 9:57 AM
  • Thx, I think that's the thread I was looking for and couldn't find.
    Wednesday, March 16, 2011 4:43 PM