I have a custom datatype it lists a bunch of media items from a specified folder as drop down down list. It was all working now has stopped working. The datatype is still there however when you click on it in the developer section you get the following error
The given key was not present in the dictionary.
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.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[KeyNotFoundException: The given key was not present in the dictionary.]
umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) in c:\Projects\umbraco-src\umbraco\cms\businesslogic\datatype\factory.cs:50
umbraco.cms.businesslogic.datatype.controls.Factory.DataType(Guid DataTypeId) in c:\Projects\umbraco-src\umbraco\cms\businesslogic\datatype\factory.cs:40
umbraco.cms.businesslogic.datatype.DataTypeDefinition.get_DataType() in c:\Projects\umbraco-src\umbraco\cms\businesslogic\datatype\DataType.cs:79
umbraco.cms.presentation.developer.editDatatype.Page_Load(Object sender, EventArgs e) in c:\Projects\umbraco-src\umbraco\presentation\umbraco\developer\DataTypes\editDatatype.aspx.cs:49
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
When you goto dataypes and try to create new datatype you don't see the datatype in the list. It would seem as though its not there anymore. I did a look in the database table cmsdatatype using the guid and its definitely there. It seems as though during the load via reflection of the datatype something is going wrong, although it was working fine. Anyone else seen this before? Any ideas on how to debug i tried doing attach process but that doesn't work because it looks as though the error is occurring during load via reflection.
Did you check if the dll containing the datatype is in the bin folder? and did you refresh the application pool to restart the site from scratch to load all datatypes? For some moments I had the same issues where I deleted the dll
The dll is definately in the bin becuase it has other datatypes and they work fine. The guid is unique else we would get another error cant remember what that is but I have seen it before. I did try giving it another guid and then re adding still no joy, also tried app pool restart i may try clearing out the cache dir in windows/.net dir. Thanks for the suggestions.
Fixed. The issue was that the dll had been updated but compiled against a different version of umbraco, the dll references were updated recompiled and all is now well.
Custom data type issue
Guys,
Using 4.0.1 asp.net 2.0 on win2k3 iis6.
I have a custom datatype it lists a bunch of media items from a specified folder as drop down down list. It was all working now has stopped working. The datatype is still there however when you click on it in the developer section you get the following error
The given key was not present in the dictionary.
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.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[KeyNotFoundException: The given key was not present in the dictionary.]
System.ThrowHelper.ThrowKeyNotFoundException() +28
System.Collections.Generic.Dictionary`2.get_Item(TKey key) +2645040
umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) in c:\Projects\umbraco-src\umbraco\cms\businesslogic\datatype\factory.cs:50
umbraco.cms.businesslogic.datatype.controls.Factory.DataType(Guid DataTypeId) in c:\Projects\umbraco-src\umbraco\cms\businesslogic\datatype\factory.cs:40
umbraco.cms.businesslogic.datatype.DataTypeDefinition.get_DataType() in c:\Projects\umbraco-src\umbraco\cms\businesslogic\datatype\DataType.cs:79
umbraco.cms.presentation.developer.editDatatype.Page_Load(Object sender, EventArgs e) in c:\Projects\umbraco-src\umbraco\presentation\umbraco\developer\DataTypes\editDatatype.aspx.cs:49
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
umbraco.BasePages.BasePage.OnLoad(EventArgs e) in c:\Projects\umbraco-src\umbraco\businesslogic\BasePages\BasePage.cs:287
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
When you goto dataypes and try to create new datatype you don't see the datatype in the list. It would seem as though its not there anymore. I did a look in the database table cmsdatatype using the guid and its definitely there. It seems as though during the load via reflection of the datatype something is going wrong, although it was working fine. Anyone else seen this before? Any ideas on how to debug i tried doing attach process but that doesn't work because it looks as though the error is occurring during load via reflection.
Regards
Ismail
Did you check if the dll containing the datatype is in the bin folder? and did you refresh the application pool to restart the site from scratch to load all datatypes? For some moments I had the same issues where I deleted the dll
Thomas
Or did you add a new datatype with the same guid?
Thomas
Thomas,
The dll is definately in the bin becuase it has other datatypes and they work fine. The guid is unique else we would get another error cant remember what that is but I have seen it before. I did try giving it another guid and then re adding still no joy, also tried app pool restart i may try clearing out the cache dir in windows/.net dir. Thanks for the suggestions.
Regards
Isamil
Did you solve this problem?
Thomas
Thomas,
Fixed. The issue was that the dll had been updated but compiled against a different version of umbraco, the dll references were updated recompiled and all is now well.
Many thanks for your help.
Regards
Ismail
is working on a reply...