Strange exception in tests after installing VS2012
-
Friday, August 17, 2012 11:37 PM
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- Edited by plinville Saturday, August 18, 2012 4:04 AM
All Replies
-
Sunday, August 19, 2012 10:48 AMModerator
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
- Marked As Answer by Amanda ZhuMicrosoft Contingent Staff, Moderator Tuesday, August 28, 2012 3:15 AM
- Unmarked As Answer by plinville Tuesday, October 16, 2012 6:37 PM
-
Thursday, January 17, 2013 8:46 PM
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
-
Monday, March 11, 2013 9:28 AM
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.
- Edited by Fabrice Durieu Monday, March 11, 2013 9:29 AM

