locked
How to add references to a Project Template? RRS feed

  • Question

  • Hi All,
    I have created a project template in Visual Studio 2008. This templated project is using a Custom Library inside the application. I have added the reference to it. But when I export it as Project Template, the reference is broken. How to apply this type of references?
    Tuesday, August 19, 2008 5:38 AM

Answers

  • Thanks Bill...

    I can say this is an Open Issue... No solution for now...
    Friday, August 22, 2008 3:03 PM
  • Hi,

    I was  also facing similar problem some time ago , I dealt with this :-

    I was also having private assemblies so I deployed them in Installation folder of .net :: C:\Program Files\Microsoft Visual Studio 9.0\Comman7\IDE .

    Then at the time of creation of project through AddFromTemplate() method I did :--.

     

    Project proj = his.dte.Solution.AddFromTemplate(...);

     

    VSLangProject.VSProject  newProject  = proj as VSLangProject.VSProject;

    newProject.References.Add("c:\Program Files\Microsoft Visual Studio 9.0\Comman7\IDE \MyDll.dll");

     

    It did for me.

    But I was unable to set the References Path for bulk of dll's like through Project-> Properties-> (References path)

    Monday, September 1, 2008 3:30 PM

All replies

  •  

    Moved to Getting Started With Visual Studio Team System.

     

    Hi Castle, you can reference How to: Add References to Templates. It describes this scenario.

    Wednesday, August 20, 2008 6:19 AM
  • Hey Bill,
    I already gone through that documentation. It explain about GAC assemblies. But in my case I am using private assemblies. Is there any solution for that?
    Wednesday, August 20, 2008 8:44 AM
  •  

    I haven't found way to add reference to private assembly in a template. From that document, it says only assemblies in GAC can be referenced in template. Maybe the product team will provide more flexibility about this in the future releases.

    Friday, August 22, 2008 7:48 AM
  • Thanks Bill...

    I can say this is an Open Issue... No solution for now...
    Friday, August 22, 2008 3:03 PM
  • Hi,

    I was  also facing similar problem some time ago , I dealt with this :-

    I was also having private assemblies so I deployed them in Installation folder of .net :: C:\Program Files\Microsoft Visual Studio 9.0\Comman7\IDE .

    Then at the time of creation of project through AddFromTemplate() method I did :--.

     

    Project proj = his.dte.Solution.AddFromTemplate(...);

     

    VSLangProject.VSProject  newProject  = proj as VSLangProject.VSProject;

    newProject.References.Add("c:\Program Files\Microsoft Visual Studio 9.0\Comman7\IDE \MyDll.dll");

     

    It did for me.

    But I was unable to set the References Path for bulk of dll's like through Project-> Properties-> (References path)

    Monday, September 1, 2008 3:30 PM