Giter VIP home page Giter VIP logo

Comments (3)

kylemc avatar kylemc commented on August 19, 2024

One of the workarounds I tried was multiple --using options, but it resulted in the following exception which pointed to a bad join on aliased types and made me think that only the single option was being read.

System.TypeInitializationException was unhandled by user code
HResult=-2146233036
Message=The type initializer for 'Cache2' threw an exception. Source=Bond TypeName=Cache2
StackTrace:
at Bond.Serialize.To[W,T](W writer, T obj)
at Bond.Bonded1.Bond.IBonded.Serialize[W](W writer) at lambda_method(Closure , Object , CompactBinaryWriter1 )
at Bond.Serializer1.Serialize(Object obj, W writer) at Bond.Serialize.To[W,T](W writer, T obj) InnerException: System.ArgumentNullException HResult=-2147467261 Message=Value cannot be null. Parameter name: field Source=System.Core ParamName=field StackTrace: at System.Linq.Expressions.Expression.Field(Expression expression, FieldInfo field) at Bond.Expressions.DataExpression.PropertyOrField(Expression expression, String name) at Bond.Expressions.ObjectParser.Field(ITransform transform, Expression structVar, UInt16 id, ISchemaField schemaField, IField field) at Bond.Expressions.ObjectParser.<>c__DisplayClassc.<Apply>b__7(<>f__AnonymousType02 <>h__TransparentIdentifier0, IField knownField)
at System.Linq.Enumerable.d__43.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at System.Collections.Generic.List1.AddRange(IEnumerable1 collection) at Bond.Expressions.ObjectParser.Apply(ITransform transform) at Bond.Expressions.SerializerTransform2.Struct(IParser parser, RuntimeSchema schema, Boolean isBase)
at Bond.Expressions.SerializerTransform2.Struct(IParser parser, RuntimeSchema schema) at Bond.Expressions.SerializerTransform2.<>c__DisplayClass2.b__0(IParser p)
at Bond.Expressions.SerializerGenerator2.GenerateSerialize(Serialize serialize, IParser parser, ParameterExpression writer, Boolean inline) at Bond.Expressions.SerializerTransform2.GenerateSerialize(SerializeWithSchema serializeWithSchema, IParser parser, RuntimeSchema schema)
at Bond.Expressions.SerializerTransform2.Value(IParser parser, Expression valueType, RuntimeSchema schema) at Bond.Expressions.SerializerTransform2.<>c__DisplayClassc.<>c__DisplayClasse.b__7(IParser fieldParser, Expression fieldType)
at Bond.Expressions.Field.Bond.Expressions.IField.Value(IParser parser, Expression valueType)
at Bond.Expressions.ObjectParser.Field(ITransform transform, Expression structVar, UInt16 id, ISchemaField schemaField, IField field)
at Bond.Expressions.ObjectParser.<>c__DisplayClassc.b__7(<>f__AnonymousType02 <>h__TransparentIdentifier0, IField knownField) at System.Linq.Enumerable.<SelectManyIterator>d__43.MoveNext()
at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection)
at System.Collections.Generic.List1.AddRange(IEnumerable1 collection)
at Bond.Expressions.ObjectParser.Apply(ITransform transform)
at Bond.Expressions.SerializerTransform2.Struct(IParser parser, RuntimeSchema schema, Boolean isBase) at Bond.Expressions.SerializerTransform2.Struct(IParser parser, RuntimeSchema schema)
at Bond.Expressions.SerializerTransform2.<>c__DisplayClass2.<GenerateSerialize>b__0(IParser p) at Bond.Expressions.SerializerGenerator2.GenerateSerialize(Serialize serialize, IParser parser, ParameterExpression writer, Boolean inline)
at Bond.Expressions.SerializerTransform2.GenerateSerialize(SerializeWithSchema serializeWithSchema, IParser parser, RuntimeSchema schema) at Bond.Expressions.SerializerTransform2.Generate(IParser parser)
at Bond.Serializer1..ctor(Type type) at Bond.Serialize.Cache2..cctor()
InnerException:

from bond.

sapek avatar sapek commented on August 19, 2024

Multiple aliases are definitely supported, e.g. see the tests.

If you post link to your project I can take a look what might be the problem.

from bond.

sapek avatar sapek commented on August 19, 2024

Since there are unit tests with multiple type aliases I suspect that this is not the problem so I'm closing this issue. Please open an issue with more specific information (ideally a repro).

from bond.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.