471,344 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,344 software developers and data experts.

EnvDTE and EnvDTE80


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.zip\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.zip\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.zip\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
means.

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,

Richard
Jul 21 '05 #1
0 2646

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jindrich Hora | last post: by
2 posts views Thread by Christina Androne | last post: by
reply views Thread by amit | last post: by
3 posts views Thread by Allen Anderson | last post: by
reply views Thread by Richard | last post: by
2 posts views Thread by GS | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.