none
Error : Value cannot be null ,Parameter name:Key

    Question

  • Hi,

      Follwoing is the error which is coming randomly on running the application ..

       Error : Value cannot be null ,Parameter name:Key  

       The project is running properly on one machine but when copied to new machine and later run from new location above error is coming.

       This error comes very randomly for intial run the application is running properly but after some time this error comes up.

        We tried changing "AllowNull" property to "true" of value property eventhough the above mentioned error is coming.

        If project is created from scratch on one's machine then this problem is not coming so frequentlyyy but when copied to new machine this eror is coming frequently.

        please can anyone suggest solution to this problem.

        or any direction for above error.

       Thanx in advance.

    Regards

    Kiran Kirdat

       

      

    Thursday, March 30, 2006 11:24 AM

Answers

  • Thanks for posting the callstack.  This is consistent with a change in the domain model format, specifically to the domain class CompanyName.ProjectName.DSLToolBox.DomainModel.ExampleModel.  Did you rename or remove this class at some point?  The easiest way to fix this would be to just recreate the file using your current model, but if you've renamed the ExampleModel class, you should also be able to open the serialized file in the XML editor, and replace "ExampleModel" with the new name.

     

    Thanks,

    Grayson

    Wednesday, April 05, 2006 12:46 AM

All replies

  •  

    I am also getting similar error.

    Can someone please help?

    Thanks in advance.

     

    Friday, March 31, 2006 9:44 AM
  • See my post here:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=328945&SiteID=1

    If this doesn't solve your problem, can you please post a callstack for the error?  To obtain this, break on System.ArgumentNullException (Debug->Exceptions, check the box next ot that exception in the tree viewv under "Common Language Runtime Exceptions"), and run your DSL with F5 (you may need to turn off "Just My Code" feature in Tools->Options->Debugger->General).

    Thanks,

    Grayson

    Tuesday, April 04, 2006 12:31 AM
  • Hi,

    The entire callstack for the error which appears on my machine is as follows:

    ************************************************************************************************

    mscorlib.dll!System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument argument) + 0x2a bytes 
      mscorlib.dll!System.Collections.Generic.Dictionary<System.Type,Microsoft.VisualStudio.Modeling.MetaClassInfo>.FindEntry(System.Type key = null) + 0x14a bytes 
      mscorlib.dll!System.Collections.Generic.Dictionary<System.Type,Microsoft.VisualStudio.Modeling.MetaClassInfo>.TryGetValue(System.Type key, out Microsoft.VisualStudio.Modeling.MetaClassInfo value = null) + 0xf bytes 
      Microsoft.VisualStudio.Modeling.Sdk.dll!Microsoft.VisualStudio.Modeling.MetaDataDirectory.FindMetaClass(System.Type type = null) + 0x2d bytes 
      Microsoft.VisualStudio.Modeling.Sdk.dll!Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.GetType(Microsoft.VisualStudio.Modeling.Partition partition = {Microsoft.VisualStudio.Modeling.Partition}, string typeName = "CompanyName.ProjectName.DSLToolBox.DomainModel.ExampleModel", string namespace = null, Microsoft.VisualStudio.Modeling.SubStore[] subStores = {Dimensions:Devil}) + 0x19f bytes 
      Microsoft.VisualStudio.Modeling.Sdk.dll!Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.DeserializeElements(Microsoft.VisualStudio.Modeling.Partition partition = {Microsoft.VisualStudio.Modeling.Partition}, System.Collections.Hashtable mapSettingIdToElement = Count = 0, ref Microsoft.VisualStudio.Modeling.SubStore[] subStores = {Dimensions:Devil}, System.Xml.XmlReader xmlReader = {Element, Name="om:Property"}, int majorVersion = 1, int minorVersion = 1, bool checkFileVersion = true, Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.Deserialized deserialized = {Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.Deserialized}) + 0xa3f bytes 
      Microsoft.VisualStudio.Modeling.Sdk.dll!Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.DeserializePartition(Microsoft.VisualStudio.Modeling.Partition partition = {Microsoft.VisualStudio.Modeling.Partition}, System.IO.Stream stream = {System.IO.FileStream}, int majorVersion = 1, int minorVersion = 1, Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.UpgradeFileFormat upgradeFileFormat = {Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.UpgradeFileFormat}, Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.Deserialized deserialized = {Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.Deserialized}) + 0x15f bytes 
      Microsoft.VisualStudio.Modeling.Sdk.dll!Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.DeserializeStore(Microsoft.VisualStudio.Modeling.Store store = {Microsoft.VisualStudio.Modeling.Store}, System.IO.Stream stream = {System.IO.FileStream}, int majorVersion = 1, int minorVersion = 1, Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.UpgradeFileFormat upgradeFileFormat = {Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.UpgradeFileFormat}, Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.Deserialized deserialized = {Microsoft.VisualStudio.Modeling.Diagnostics.XmlSerialization.Deserialized}) + 0x91 bytes 
      Microsoft.VisualStudio.Modeling.Sdk.Utilities.dll!Microsoft.VisualStudio.Modeling.Utilities.ImsDocData.ImsLoad(Microsoft.VisualStudio.Modeling.Store store = {Microsoft.VisualStudio.Modeling.Store}, System.IO.Stream stream = {System.IO.FileStream}) + 0x9c bytes 
      Microsoft.VisualStudio.Modeling.Sdk.Utilities.dll!Microsoft.VisualStudio.Modeling.Utilities.ImsDocData.Load(string fileName = "D:\\DSLToolsProject\\2903\\DSLToolBox\\DSLToolBox\\Debugging\\Test.biz", bool isReload = false) + 0x95 bytes 
      Microsoft.VisualStudio.Modeling.Sdk.Shell.dll!Microsoft.VisualStudio.EnterpriseTools.Shell.DocData.LoadDocData(string fileName = "D:\\DSLToolsProject\\2903\\DSLToolBox\\DSLToolBox\\Debugging\\Test.biz", bool isReload = false) + 0x2f bytes 
      Microsoft.VisualStudio.Modeling.Sdk.Shell.dll!Microsoft.VisualStudio.EnterpriseTools.Shell.ModelingDocData.LoadDocData(string fileName = "D:\\DSLToolsProject\\2903\\DSLToolBox\\DSLToolBox\\Debugging\\Test.biz", bool isReload = false) + 0x2ac bytes 
      Microsoft.VisualStudio.Modeling.Sdk.Shell.dll!Microsoft.VisualStudio.EnterpriseTools.Shell.DocData.LoadDocData(string fileName = "D:\\DSLToolsProject\\2903\\DSLToolBox\\DSLToolBox\\Debugging\\Test.biz") + 0x86 bytes 
      [Native to Managed Transition] 

    ********************************************************************************************************************

    Tuesday, April 04, 2006 4:58 AM
  • Thanks for posting the callstack.  This is consistent with a change in the domain model format, specifically to the domain class CompanyName.ProjectName.DSLToolBox.DomainModel.ExampleModel.  Did you rename or remove this class at some point?  The easiest way to fix this would be to just recreate the file using your current model, but if you've renamed the ExampleModel class, you should also be able to open the serialized file in the XML editor, and replace "ExampleModel" with the new name.

     

    Thanks,

    Grayson

    Wednesday, April 05, 2006 12:46 AM
  •  

    My error is on my  HP IMAGE ZONE PLUS.  When I try to access I get " The program has encountered and unexpected error:  Parameter cannot be null.  Parameter name: serialization Stream"

     

    It would great if you could help me resolve it.   Thank you.

     

     

    Veronica

    Thursday, August 23, 2007 4:03 AM
  • Hi Grayson,

    I am using Team foundation server. Recently, I come across a weird problem. When I tried to check in  a project, the Source control is giving me an weird error , saying that Error : Value cannot be null ,Parameter name:Key.

    Do you have any idea why this is happening?
    Wednesday, September 19, 2007 12:58 AM
  •  

    I've had that error when I hade an open xsd-file in my solution. Closed it and the errormessage disappeared. No probs with the xsd.

     

    Open your project, look for open xsd-files. Close them before you save + close your project.

     

    Friday, October 12, 2007 9:30 AM
  • Hi Jonas,

    I have tried to close everything in the project and then close and restarted the VS, but it still having the same error.

    Any ideas?

    Cheers,

    Jack
    Thursday, October 18, 2007 7:05 AM
  • Hi Kiran,

    I worked on the issue you have mentioned above.

    1. Select schema what ever is available in your project.
    2. Right click and select property

    3.Select Build Action = "BTS Compile"

    I am sure your problem will get resolved.

    Thanks
    Nasar Faridi

    Thursday, November 05, 2009 9:16 AM
  • Hi, thx to all, after some hours digging in order to get a solution this post aim me to the solution, In my case the service was compiled as http:{SITE}\XXXX\Service.svc, but the deploy site was cofigured as http:{SITE}\YYYY\XXXX\Service.svc, so the way to solve was modified the .compiled file

    Changing the paramenters

    virtualPath=\XXXX\Service.svc for \YYYY\XXXX\Service.svc

    customString=\XXXX\Service.svc for \YYYY\XXXX\Service.svc

    filedep name=\XXXX\Service.svc for \YYYY\XXXX\Service.svc

     

    And works !!

     

    Leo

    Friday, June 18, 2010 5:19 PM