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

BUG In EnvDTE.ProjectItems.AddFromTemplate Method

P: n/a
I seem to have found a bug in the AddFromTemplate method of the ProjectItems
object. I'm asking that someone can double-check/verify this bug before I submit
it.

I created a wizard (the vsz file for it along with a vsdir). I wrote a wizard
object that implements EnvDTE.IDTWizard. In the Implemented Execute Method, I
have the code to show a form then execute a method I named CreateSolution. All
is well, I can successfully create a solution and add 5 projects (4 are normal
class projects from EmptyProject.vbproj) using IO.File.Copy and then
DTE.Solution.AddFromFile. (the 5th uses EmptyWebProject.vbproj).

Now, in the web project, I try to add a file using AddFromTemplate. If I try to
add any .vsz wizard file using AddFromTemplate, it fails..it only fails if the
..vsz wizard file points to a file (IE: Class.vsz points to Class.vb) contains
wizard directives (IE: contains [!output..]). It works if I try to add a .vsz
wizard file that does not contain a directive (IE: vbscript.vsz), it works. So,
through debugging, I found that if I try to add a .vsz wizard that does NOT point
to a file that contains a directive, then I can successfully add any other .vsz
wizard files after that without any errors. I can then delete the blank
vbscript.vbs file I added first and the project is set up correctly.

Maybe a little bit of work to try and test this, but it is a bug I am sure and
wish that someone would help verify this for me. The error message I kept
getting is "Unspecified Error".

THanks in advance,
Mythran


Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You scratch my back, I scratch yours...

I could seriously use the code described in your post, send it my way, we
can converse about bugs all you want :)

"Mythran" wrote:
I seem to have found a bug in the AddFromTemplate method of the ProjectItems
object. I'm asking that someone can double-check/verify this bug before I submit
it.

I created a wizard (the vsz file for it along with a vsdir). I wrote a wizard
object that implements EnvDTE.IDTWizard. In the Implemented Execute Method, I
have the code to show a form then execute a method I named CreateSolution. All
is well, I can successfully create a solution and add 5 projects (4 are normal
class projects from EmptyProject.vbproj) using IO.File.Copy and then
DTE.Solution.AddFromFile. (the 5th uses EmptyWebProject.vbproj).

Now, in the web project, I try to add a file using AddFromTemplate. If I try to
add any .vsz wizard file using AddFromTemplate, it fails..it only fails if the
..vsz wizard file points to a file (IE: Class.vsz points to Class.vb) contains
wizard directives (IE: contains [!output..]). It works if I try to add a .vsz
wizard file that does not contain a directive (IE: vbscript.vsz), it works. So,
through debugging, I found that if I try to add a .vsz wizard that does NOT point
to a file that contains a directive, then I can successfully add any other .vsz
wizard files after that without any errors. I can then delete the blank
vbscript.vbs file I added first and the project is set up correctly.

Maybe a little bit of work to try and test this, but it is a bug I am sure and
wish that someone would help verify this for me. The error message I kept
getting is "Unspecified Error".

THanks in advance,
Mythran


Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.