RDN-95
1

Reflection issue

Scott on 6/27/2015 6:18 PM

Scott on 9/13/2015 7:28 PM

%
(hrs)
Logged

0 (hrs)


 Description

Hey Icatalin, Since your good with WPF, the next few tasks are for you.

  1. These issues with the Category of RDN Scoreboard are the scoreboard project.  Within the RDNation source, find the RDN Scoreboard > then find the solution file.
  2. To recreate this issue.
  3. Make sure to pull the latest from GIT.
  4. Debug the scoreboard.
  5. Create a New Game.
  6. Go to team manager.
  7. Name the Teams.
  8. Add 1 skater per team.
  9. Close the Team Manager.
  10. Save Game
  11. This save game is where the error will pop up.
  12. Its trying to serialize Portable classes.  That inlies the problem.  I don't know if you can serialize Portable classes due to the Serialization namespace NOT being available in Portable Libraries.

Can you review this error.  If I am UNABLE to serialize the game and deserialize it. we need to come up with a better way.  Maybe Newtonsoft.Json Serialize into JSON.

Let me know what you believe we should do.

 

 

Method: ImportTypeMapping
There was an error reflecting type 'Scoreboard.Library.ViewModel.Members.TeamViewModel'.

at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter) at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace, RecursionLimiter limiter) at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace) at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace) at Scoreboard.Library.ViewModel.GameViewModel.loadTeamRosterFromXml(String fileName, TeamNumberEnum team) in c:\Personal\RDN\RDNScoreboard\RDN.Scoreboard.Library\ViewModel\GameViewModel.cs:line 1719  

Method: InitializeStructMembers
There was an error reflecting property 'Logo'.

at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter) at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter) at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)  

Method: ImportTypeMapping
There was an error reflecting type 'RDN.Portable.Classes.Team.TeamLogo'.

at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter) at System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, String ns, Type choiceIdentifierType, Boolean rpc, Boolean openModel, RecursionLimiter limiter) at System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel parent, FieldModel model, XmlAttributes a, String ns, RecursionLimiter limiter) at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)  

Method: ResolveType
Could not load file or assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) at System.RuntimeType.GetCustomAttributes(Boolean inherit) at System.Xml.Serialization.XmlAttributes..ctor(ICustomAttributeProvider provider) at System.Xml.Serialization.XmlReflectionImporter.GetAttributes(Type type, Boolean canBeSimpleType) at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)  

Additional Information: 2.2.9:
 
Skip Navigation Links
 

Scott Friday, September 11, 2015 4:07 PM #

okay, if this is working, then I am happy with it. Thanks!

 

Icatalin Friday, September 11, 2015 2:14 PM #

I have managed to run in the end ( the problem was that I have opened it in VS 2012 and only VS2013 or VS2012 with some additional libs on Win8 can be used to run that target profile of the project - Profile259.

But now I am not able to recreate those bugs, everything Serialization and Deserialization from xml works perfect. I have spend some time debugging this on different scenarios, load, save.. to xml ( teams, games) and all the code is running fine, including the lines where a bug should appear. 

Also that System.Net.Http error is back if you change the target for RDN.Portable from 4.5 to 4.0. (I know that is 4.5 just saying). So maybe it is an error from a dll. or something like this.

This is what I have been able to do so far for this bug.

 

Scott Friday, September 04, 2015 6:50 PM #

this is a Nuget Error.

You should be able to find the package here: C:\Personal\RDNation\packages\Microsoft.Net.Http.2.2.28\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll

 

Icatalin Saturday, August 29, 2015 3:01 PM #

For some reason the Portable is failing to build, this is the error:

The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) D:\Personal\RDNation\RDN.Portable\Classes\API\RestRequest.cs 6 18 RDN.Portable  (check the attachments)

I checked the path, versions etc. I wasn't able to make it build. I tried really hard, I will think of other possible causes but if you have a suggestion it would be helpful. Thanks.

 


Powered by BugNET 1.6.339.0