I need to tweak the project settings of a VB.NET project from within my VSIP
project. Specifically, I need to set the References in a VB.NET project
whose referenced assembly paths are not known until runtime. I want to do
this from within my unmanaged code but cannot find a header file for the
VSProject interface. I see that VS.NET ships the VSLangProj.dll assembly
for developing within .NET, but the VSIP SDK doesn't have an equivalent
library for VB/C# projects. Is there some sort of VB.NET developers SDK
that I need?
"Ed Dore [MSFT]" - 09 Aug 2004 22:42 GMT
Hi Jim,
Regarding setting project properties from your VSIP project. The DTE
automation model can be used to do this. Specifically,
VSLangProj.References.Add. You can access this via the DTE automation
object in your VSIP package. The DTE automation object can be retrieved
using QueryService.
For details on how to retrieve the DTE automation object from an unmanaged
(C++) VSIP package, see one of the first logs in Dr. eX's blog:
http://blogs.msdn.com/dr._ex/archive/2004/03/09/86972.aspx
From a managed package object, you may utilize the GetService method
implemented on the Package object itself. For example:
DTE dte = (DTE)GetService(typeof(DTE));
Given a reference to an IServiceProvider interface, such as the one passed
to the IVsWindowPane::SetSite implementation of a ToolWindow object, you
can create a temporary ServiceProvider object and invoke its GetService
method to retrieve the DTE object. For example:
ServiceProvider sp = new ServiceProvider(vsServiceProvider);
DTE dte = (DTE)sp.GetService(typeof(DTE));
(where vsServiceProvider is an IOleServiceProvider member initialized with
the
IServiceProvider interface passed to the toolwindows
SetSite function)
Sincerely,
Ed Dore [MSFT]
This post is 'AS IS' with no warranties, and confers no rights.