By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,201 Members | 922 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,201 IT Pros & Developers. It's quick & easy.

EnvDTE and EnvDTE80

P: n/a

I am using Visual Basic Express (May release) and I am trying to create a
solution programatically. How do I do this? I know I need to use the
AddFromTemplate but how do I determine the path to the template that I want
to use, let's say the template is the "winfxapplication" template, which on
my machine is

"C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\VBExpress\ProjectTemplatesCache\1033 \\windowsapplication.vstempl ate"

Or do I point it at the .vbproj file:

"C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\VBExpress\ProjectTemplatesCache\1033 \\windowsapplication.vbproj"

I'm assuming there are just a few lines of code required. First of all, I
want to create a VS2005 object. I have tried:

Dim env As EnvDTE80.DTE2 =
CType(Microsoft.VisualBasic.Interaction.CreateObje ct("VisualStudio.DTE.8.0",
""), EnvDTE80.DTE2)

but that tells me it cannot create the ActiveX object. I then tried:

Dim env As EnvDTE.DTE =
CType(Microsoft.VisualBasic.Interaction.CreateObje ct("VisualStudio.DTE.7.1",
""), EnvDTE.DTE)

and that creates the object, so when I do this:

ENV.Solution.ADDFromTemplate("C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\VBExpress\ProjectTemplatesCache\1033 \\WinFXApplication.vbproj",
"e:\mytests", "myproject.vbproj")

I get the message "The file blah blah is not a valid project file. The
project file is missing the 'VisualStudioProject' section." whatever that

I think I am on the right track here, can anybody out there just straighten
me out on this? I am starting to tear my hair out.

Thanks in advance,

Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.