|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynammically adding project references into the webproject.I am creating a visual studio template in VS.Net 2005. It contains webproject or website as one of the project. I am successfully abele to add the references into the other project. using this following lines of code. foreach (Project proj in projs){ if (!proj.Name.Contains("BusinessObjects") && !proj.Name.Contains("http")) { VSProject2 vsProj = (VSProject2)proj.Object; vsProj.References.AddProject(boProj); } } As I am trying to add the project reference into webproject I will get an error as "unable to casat the object of type System.__ComObject into the type VSLangProj.VSProject2". Actually I am getting error in the line VSProject2 vsProj = (VSProject2)proj.Object; When proj>Object is other than webproject this casting works fine but it gives error when proj.Object contains the reference of the website project. Thanks in Advance Regards, Anubhav Jain MTS Persistent Systems Pvt. Ltd. Ph:+91 712 2226900(Off) Extn: 2431 Mob : 094231 07471 www.persistentsys.com Persistent Systems -Software Development Partner for Competitive Advantage. Persistent Systems provides custom software product development services. With over 15 years, 140 customers, and 700+ release cycles experience, we deliver unmatched value through high quality, faster time to market and lower total costs. |
|||||||||||||||||||||||