Strange exception in tests after installing VS2012

Unanswered Strange exception in tests after installing VS2012

  • sexta-feira, 17 de agosto de 2012 23:37
     
     

    I have one computer where I installed vs2012. On that computer a set of unit tests do not pass because the exception below is raised.

    This only happens on the machine that VS2012 is installed on and it fails in both VS2012 and VS2010.  All other machines with only VS2010 installed does not happen to.

    What is weird is that it happens when I am doing a DataSet.ReadXML(memorystream). The MemoryStream is built from a string that is a valid xml representation of the dataset because. I know this because I changed the mock to a the concreate representations of the interfaces.

    Is there something about VS2012 that I need to know about to get this to run?

    I am using Teleriks free JustMock.  I am mocking my IBusinessPrinciple and IBusinessIdentity interfaces which inherit IPrinciple and  IIdentity. The Securty project that has the interfaces is .Net 3.5. The unit tests are compiled under .Net 4.0.

    Result Message: 
    Test method Customer_Tests.CustomerEditList_Tests.CustomerEdit_SaveCreatesRecord threw exception:
    System.Exception: Error in Save in  CustomerRecord. Type is not resolved for member 'IBusinessPrincipal_Proxy_bc517b3313e4493786c4c266c18480c4,Telerik.JustMock, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b221631f7271365'. ---> System.Runtime.Serialization.SerializationException: Type is not resolved for member 'IBusinessPrincipal_Proxy_bc517b3313e4493786c4c266c18480c4,Telerik.JustMock, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b221631f7271365'.
    Result StackTrace: 
    at System.AppDomain.get_Evidence()
       at System.AppDomain.get_EvidenceNoDemand()
       at System.AppDomain.get_Evidence()
       at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
       at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
       at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
       at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
       at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at System.Xml.XmlConfiguration.XmlReaderSection.get_ProhibitDefaultUrlResolver()
       at System.Xml.Schema.Parser..ctor(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
       at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)
       at System.Data.DataSet.ReadXSDSchema(XmlReader reader, Boolean denyResolving)
       at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
       at System.Data.DataSet.ReadXml(TextReader reader)
       at MAS.DAL.REQUEST.RequestManager.GetRequestDefinition(String RequestName) in E:\Projects\MAS Applications\Experimental\Source\MAS.DAL.RequestManager\RequestManager.vb:line 86
       at MAS.DAL.Request.DefaultRequestStorage.GetRequest(String name) in E:\Projects\MAS Applications\Experimental\Source\MAS.DAL.REQUEST\DefaultRequestStorage.vb:line 16
       at MAS.DAL.Request.RequestStorage.GetRequest(String name) in E:\Projects\MAS Applications\Experimental\Source\MAS.DAL.REQUEST\RequestStorage.vb:line 24
       at CSLA.SavableBase.FillBOO() in E:\Projects\MAS Applications\Experimental\Source\CSLA\SavableBase.vb:line 319
       at CSLA.SavableBase.GetRequests() in E:\Projects\MAS Applications\Experimental\Source\CSLA\SavableBase.vb:line 305
       at CSLA.SavableBase.Save() in E:\Projects\MAS Applications\Experimental\Source\CSLA\SavableBase.vb:line 290
     --- End of inner exception stack trace ---
        at CSLA.SavableBase.Save() in E:\Projects\MAS Applications\Experimental\Source\CSLA\SavableBase.vb:line 294
       at CSLA.GenericEditableDomainModel`1.Save() in E:\Projects\MAS Applications\Experimental\Source\MAS.GenericBases\GenericEditableDomainModel.vb:line 172
       at Eddy_Tests.CustomerEditList_Tests.CustomerEdit_SaveCreatesRecord() in e:\Projects\MAS Applications\Experimental\Source\MAS.EddyLib\iEddy_Tests\CustomerEditList_Tests.cs:line 172


    • Editado plinville sábado, 18 de agosto de 2012 04:04
    •  

Todas as Respostas

  • domingo, 19 de agosto de 2012 10:48
    Moderador
     
     

    Hi plinville,

    Thank you for posting in the MSDN forum.

    According to your description, I advice that you can try to uninstall the VS2010 completely on that machine 

    having VS2010 and VS2012, and then run your unit tests. 

    Or you can directly run your unit tests on another machine only having VS2012. 

    After that, you check if the exception still occurs. 

    Sometimes two Visual Studios on the same machine may cause some issues.

    If possible, you could provide some detailed information about your unit tests so that we can repro 

    your scenario to resolve your problem better.

    Thanks,



    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us

  • quinta-feira, 17 de janeiro de 2013 20:46
     
     

    I have a similar exceptions with custom principal and identity. All unit tests that uses the same principal are passed except one with return object is DataTable from a remoting service. I'm using .NET 4.0 with Visual Studio 2012. I have both 2010 and 2012 Visual Studio installed on my PC. The same unit tests are passed in Visual Studio 2010 without any exceptions.

    Type is not resolved for member 'MASApplicationServices.Data.MASPrincipal,BCT.RSM.ApplicationServicesData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

       at System.AppDomain.get_Evidence()
       at System.AppDomain.get_EvidenceNoDemand()
       at System.AppDomain.get_Evidence()
       at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
       at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
       at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
       at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
       at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at System.Xml.XmlConfiguration.XmlReaderSection.get_ProhibitDefaultUrlResolver()
       at System.Xml.Schema.Parser..ctor(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
       at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)
       at System.Data.DataSet.ReadXSDSchema(XmlReader reader, Boolean denyResolving)
       at System.Data.DataSet.ReadXmlSchema(XmlReader reader, Boolean denyResolving)
       at System.Data.DataTable.DeserializeDataTable(SerializationInfo info, StreamingContext context, Boolean isSingleTable, SerializationFormat remotingFormat)
       at System.Data.DataTable..ctor(SerializationInfo info, StreamingContext context)

    If I change this remoting service to return a string, then there is no problem.

    Any ideas?

    Patrick Xie

  • segunda-feira, 11 de março de 2013 09:28
     
      Contém Código

    I got the same issue

    Fixed by applying the tip provided here

    If i change my Identity from
    
    public MyIdentity : GenericIdentity
    { }
    
    to
    
    public MyIdentity : MarshalByRefObject, IIdentity
    { }
    
    all of my tests are gettin green.