Search code examples
vstovisual-studio-debuggingms-projectproject-properties

Loading specific test file for debugging MSProject Add-In


I am developing a MSProject add-in with VSTO and I have a question about debugging.

How do I use the Start Option->Command line arguments to load a specific MS Project file?

I have tried using [drive:][path]filename.mpp but the file doesn't load.

Otherwise everything is fine. I can load a file manually and debug properly.

Thanks for any assistance.


Solution

  • You can use the following command line example to load MS Project with a specific MPP file:

    winproj "c:\projects\Annual Report Preparation.mpp"

    For Visual Studio Project->Debug->Start Options->Command Line arguments - you can use the path enclosed in quotations. The gotcha here is that you must also assign the Start Action->Start External program for this to work - this is a VS bug.

    "c:\projects\Annual Report Preparation.mpp"

    Use ... and set Start External Program (depending on your Office version):

    C:\Program Files (x86)\Microsoft Office\Office15\WINPROJ.EXE

    See MS Office for further MS Project command line reference.