Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Error 1001: Item has already been added. Key in dictionary
 

Error 1001: Item has already been added. Key in dictionary

Playing around, (changing the generated package rebuilding ...) I have encountered the following:

Error 1001. An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete. --> Item has already been added. Key in dictionary: 'D:\alx\Projects\GuidancePackage1\GuidancePackage1\bin\Debug\Templates\Solutions\Projects\ConsoleApplication\ConsoleApplication.vstemplate' Key being added: 'D:\alx\Projects\GuidancePackage1\GuidancePackage1\bin\Debug\Templates\Solutions\Projects\ConsoleApplication\ConsoleApplication.vstemplate', (NULL), (NULL), (NULL).


Now I cannot repair the package or uninstall. The same error is reported.

What can be done ?

alx
andreilx  Tuesday, May 17, 2005 9:10 AM

Hi alx,

Have you changed the name or guid of an already compiled (thus registered) package and tried to recompile it? I can repro the issue when doing the previous.

What is happening here is the templates will already be registered for another package, from the exact same location, and that won't work.

You could try the following workaround:
 
1 - Open regedit
2 - Open the HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\{77d93a80-73fc-40f8-87db-acd3482964b2}\Templates
3 - Find the key that contains the guidance package you renamed (or the guid). There's an entry PackageName that will help you find out which one is the offending key. You will also see all the templates registered so you will be able to infer it by the templates location.
4 - Delete the key
5 - Restart VS

Hope this helps,

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Followers of the IHttpHandler
http://clariusconsulting.net/vga

vga  Tuesday, May 17, 2005 9:52 PM
Hi alx,

Could you please describe "playing around"? -- some repro steps will surely help diagnosing the issue.

Thanks,

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Followers of the IHttpHandler
http://clariusconsulting.net/vga
vga  Tuesday, May 17, 2005 7:41 PM

Hi alx,

Have you changed the name or guid of an already compiled (thus registered) package and tried to recompile it? I can repro the issue when doing the previous.

What is happening here is the templates will already be registered for another package, from the exact same location, and that won't work.

You could try the following workaround:
 
1 - Open regedit
2 - Open the HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\{77d93a80-73fc-40f8-87db-acd3482964b2}\Templates
3 - Find the key that contains the guidance package you renamed (or the guid). There's an entry PackageName that will help you find out which one is the offending key. You will also see all the templates registered so you will be able to infer it by the templates location.
4 - Delete the key
5 - Restart VS

Hope this helps,

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Followers of the IHttpHandler
http://clariusconsulting.net/vga

vga  Tuesday, May 17, 2005 9:52 PM

Worked like a charm. Thank You !

What I have done ? Hard to say.

I have generated a package, and I have started to modify the source files, trying to understand the structure. I have copied some source files, renamed them, modified them, compiled ...

After the error ocurred I was not able to open a Guidance package. I will try to reproduce-it now.

My goal was to understand how is supposed to be used.
I can see that this has a huge potential and I want to convert (and expand) my CodeSmith templates with this package.

What puzzles me right now is that I have searched the registry   ... with no result.

Yes: search whole string was checked !   Damn !

alx

andreilx  Wednesday, May 18, 2005 9:04 AM

Hi,

I am getting this error when i've tried connecting my ASP.NET web application written in C# with mysql. But the cause of error as displayed by stack trace is the code where I am filling the data set using data adapter.

i am using Mysql Server Version 5.0 on my local machine and Mysql Connector version : mysql-connector-net-5.0.2-beta

I am not getting this error locally on my machine (Windows XP) but on the server this error occurs frequently, the server is (Windows 2003 SP2).

Server Error in '/' Application.
Item has already been added. Key in dictionary: '2128449582' Key being added: '2128449582'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: '2128449582' Key being added: '2128449582'

Source Error:

Line 75: DataSet ds = new DataSet();
Line 76: MySqlDataAdapter adapter = new MySqlDataAdapter(command);
Line 77: adapter.Fill(ds);
Line 78: connection.Close();
Line 79: if (ds.Tables.Count > 0)


Source File: c:\wow\App_Code\Services.cs Line: 77

Stack Trace:

[ArgumentException: Item has already been added. Key in dictionary: '2128449582' Key being added: '2128449582']
System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +2807907
System.Collections.Hashtable.Add(Object key, Object value) +11
MySql.Data.MySqlClient.ProcedureCache.AddNew(MySqlConnection connection, String spName) +106
MySql.Data.MySqlClient.ProcedureCache.GetProcedure(MySqlConnection conn, String spName) +104
MySql.Data.MySqlClient.StoredProcedure.ProcessCommandText() +153
MySql.Data.MySqlClient.StoredProcedure.get_ProcessedCommandText() +16
MySql.Data.MySqlClient.Statement.BindParameters() +38
MySql.Data.MySqlClient.PreparableStatement.Execute(MySqlParameterCollection parameters) +31
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +527
MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +4
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +86
Services.ExecWithResult(String ProcName, MySqlParameter[] Params) in c:\wow\App_Code\Services.cs:77
Message.GetFriends(Int32 mem_id) in c:\wow\App_Code\Message.cs:172
Profiles_memberfriends.fillmembers() in c:\wow\Profiles\memberfriends.aspx.cs:99
Profiles_memberfriends.Page_Load(Object sender, EventArgs e) in c:\wow\Profiles\memberfriends.aspx.cs:70
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

If you can help out me on this issue, it will be of great help.

Thanks and Regards,

Vishwa


Vishwa Mohan Saxena  Wednesday, November 07, 2007 1:05 PM

You can use google to search for other answers

Custom Search

More Threads

• GAX - Integrated with DSL Tool
• Value Editor in custom wizard
• Simulate DependentUpon with DTE class
• Challenge in writing a T4 template with Arguments created onthe fly based on a xsd file
• Cannot install GAX/GAT June 2006 CTP
• How to incorporate data access package into custom package
• Recipe Framework Error when created SCSF project
• "Toolkit is already installed" but it's not
• Evaluator ValueProvider error
• Installing Clarius SFT for July 2007 GAT CTP