473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

BUG In EnvDTE.ProjectItems.AddFromTemplate Method

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
1 2715
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tushar Shelar | last post by:
I have created an ADD In for Visual studio .net 2003 which adds ASPX and .VB (Code behind files) to the project. I am using the AddFromTemplate method of the ProjectItems collection to add the...
0
by: Richard | last post by:
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...
0
by: Jindrich Hora | last post by:
This code is in MSDN as example for attach to active instance EnvDTE.DTE. (example in C#) EnvDTE.DTE myDTE = (EnvDTE.DTE)...
2
by: Christina Androne | last post by:
Hi Has anybody encountered this: EnvDTE.DTE env = new EnvDTE.DTE(); raises this exception: {"COM object with CLSID {3C9CFE1E-389F-4118-9FAD-365385190329} is either not valid or not...
0
by: Mythran | last post by:
I have a Wizard project I'm working on to create a solution, add projects to the solution, yadda yadda. Now I'm trying to add classes/modules using the .vsz wizard file. I tried using the...
3
by: Dean Slindee | last post by:
I would like to count lines in a project using code in a VB form. Need EnvDTE as an Imports statement. Can this be done? If so, I would then recode the following into VB: foreach...
1
by: Mythran | last post by:
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...
1
by: Steph | last post by:
hello, i created a c# toolbar addin for vs2005, but i don't arrive detect when a new file is opening in edit mode. I want update the ProjectItems ... must i create a thread runner and test all x...
0
by: Gerrit Beuze | last post by:
Hi all, I'd like to get at the real underlying type when using the EnvDTE.Debugger Currently I do this: EnvDTE.Thread thread = dte.Debugger.CurrentThread; foreach (StackFrame frame in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.