This project is read-only.

Using the VS Add-In

Installing the VS Add-In
This add-in only works with VS 2008. This add-in is still in an early stage of development as most of our work has been focused on the actual pipeline generation work rather than the VS integration. It should work well enough to help you get started and develop your pipeline but it isn't as flexible and robust as we would eventually like. In particular it requires a fairly specific solution structure (outlined below). Error reporting is limited to a dialog that gives you the ToString of any exception that is thrown.

You can download the current release here: Pipeline Builder CTP March-2008

The installation program will place files in the specfied directory and will install the necessary components into the GAC, but it will not register the add-in with VS.
To register the installed add-in with VS you need to:
  1. Start VS
  2. Click on the Tools->Options menu item
  3. Select the Environment->Add-In/Macros Security item
  4. Add the path where you installed this addin to the "Add-in File Paths" list (default is c:\Program Files\Microsoft\Visual Studio Pipeline Builder)
  5. Restart VS

After you restart VS you should see a new item in your Tools menu list with a smiley icon and the name "PipelineBuilder"

Settuping up your Solution
The VS add-in works best when you have a fairly specific set-up in your solution. Your .sln file should be in one folder with each project in sub-folders (this is the default setting when creating a new project/sln in VS and you choose the "Create Directory For Solution" option). The output of your projects should be redirected to a single output folder that is a direct subfolder of the solution's folder. Additionally, the output for your contract project should be in a "Contracts" subfolder underneath your output folder. With this setup the host will go directly into "output" and it can use the PipelineStoreLocation.ApplicationBase enum for finding add-ins in that directory.

To redirect the output of a project you need to right-click on the project in "Solution Explorer" and hit properties. From there you click on the "Build" tab and towards the bottom of that path you can find the "Ouput Path" text box. For your Contracts project you would want a path like "..\output\Contracts", the corresponding host path would be "..\output\" and the add-ins (if built with the same solution) would have the path "..\output\AddIns\MyAddInName". The below screen show shows the output settings for a sample Contracts assembly project:

Visually the directory structure should look like this:
  • Solution Directory
    • Solution File
    • Contract Project Directory
    • Host Project Directory (optional)
    • Output directory (the name is up to you)
      • Contracts (your contract project should build here)

For your convenience we have a solution with an empty Contracts project set up according the above guidelines available here: Sample- Blank Pipeline Project
For more information on going from this blank project to a working contract solution please see this page

Running the PipelineBuilder Add-In
Once you've set your solution up, as described above, you can simply open it and use the tool. You can run the tool by clicking on the "PipelineBuilder" item under your tools menu in VS. It will pop up this dialog:
It will try and guess which project in your current solution is the "Contract" project and if it guesses incorrectly you can choose the correct one from the "Contract Source Project" drop down box. The default values for the "Project Location" and "Build Location" were determined by inspecting the "Contract Source Project" and should be correct if you followed the guidelines above.

Once you hit "Ok" it will examine the project output of your "Contract Source Project" (Important: this tool examines your binary and not the source code, if this project is not built the tool won't work) and will take care of the rest:
  • If the projects for the various pipeline segments are not part of your solution it will:
    • Create them in the in the directory specified
      • If the project being generated is not part of the solution but a directory with its name is located in the "Project Location" path then it will delete that directory
    • Set up the references appropriately
    • Set up their build paths appropriately
    • Add the generated source files to each project with a .generated.cs extension
  • If the projects for the various pipeline segments are part of your solution it will:
    • Reuse the existing projects
    • Delete all files with the .generated.cs extension
    • Add the generated source files to each project with a .generated.cs extension

Important: if you have modified any of the generated source files you should remove the .generated section from the file name to prevent the tool from deleting it. You should also mark it's class with the CustomPipelineAttribute to avoid have the tool re-generate the code you've decided to customize. For more information on this attribute see Using PipelineHints to Customize Output

After the tool is finished you should be able compile and everything should be set. If you are developing the host application concurrently simply add a reference from it to the appropriate view project and do the same for the add-ins. Remember to change properties of the add-ins reference to its view and set "CopyLocal=False". For the host the default value of "CopyLocal=True" is generally correct.

If, after running the tool a dialog pops up reporting the following exception then it means that it could not find your contract assembly and that you just need to rebuild that project.
System.Reflection.TargetInvocationException: Exception has been thrown 
by the target of an invocation. ---> System.IO.FileNotFoundException: 

Last edited Jan 30, 2008 at 6:45 PM by JesseKaplan, version 12


rogeclub Sep 5, 2009 at 11:25 AM 
There appears to be an issue using VS2008 on Windows7. When generating the pipeline for the 1st time it calls each of the assemblies Template rather than say "AddInViews". This causes issues when building the AddInStore.

To fix it make sure all the projects generate the assembly using the same name as the project generated by the tool.

quattro Apr 30, 2008 at 9:33 PM 
Couple of comments regarding the sample solution. It seems the System.Addin and System.Addin.Contract references in the sample contracts project references the 2.0 framework, is that an issue? Also, when I open the solution it prompts for TFS credentials from I ran it in offline mode but just thought I'd let you know.