Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface inheritance breaks during serialization when same property name is found in more than one interface #2717

Closed
SeanFeldman opened this issue Apr 23, 2015 · 12 comments
Assignees
Labels
Milestone

Comments

@SeanFeldman
Copy link
Contributor

Who's affected

  • Anyone who's trying to create an interface based message that has interface inheritance with overloaded property

Symptoms

  • Exception TypeLoadException is thrown at runtime with a message similar to the following: Method 'get_[overloaded_property]' in type '[type_name]__impl' from assembly '[assebly_name]' does not have an implementation.

Repro code

        [Test]
        public void Should_map_when_deriving_from_another_interface_with_the_same_property_name_but_different_type()
        {
            var mapper = new MessageMapper();
            var genericInterfaceType = typeof(InterfaceWithGenericProperty<IBar>);
            mapper.Initialize(new[] { genericInterfaceType });
            Assert.NotNull(mapper.GetMappedTypeFor(genericInterfaceType));
        }

        public interface InterfaceWithGenericProperty
        {
            object Original { get; set; }
        }

        public interface InterfaceWithGenericProperty<T> : InterfaceWithGenericProperty
        {
            new T Original { get; set; }
        }

        public interface IBar
        {
            string Yeah { get; set; }
        }

        public class FancyMessage : InterfaceWithGenericProperty<IBar>
        {
            public IBar Original { get; set; }

            object InterfaceWithGenericProperty.Original
            {
                get { return Original; }
                set { Original = (IBar)value; }
            }
        }

Desk case: https://nservicebus.desk.com/agent/case/10128

SeanFeldman added a commit that referenced this issue Apr 23, 2015
@johnsimons johnsimons changed the title Interface inheritance breaks during serialization when same property name is found in more than one inteface Interface inheritance breaks during serialization when same property name is found in more than one interface Apr 28, 2015
@johnsimons
Copy link
Member

@SeanFeldman what is the criticality of this issue ?
Is this a hotfix, patch or next major ?

@SeanFeldman
Copy link
Contributor Author

@johnsimons patch I'd say. We have sent nuget package (generated by hotfix branch) to validate fix by @danielmarbach is working and it does.

@johnsimons johnsimons added this to the 5.3.0 milestone Apr 28, 2015
@SeanFeldman
Copy link
Contributor Author

@johnsimons we've discussed this to be a PR, but we don't have a release-5.3 branch. What should it be branched off - develop is already v6. Thanks

@SimonCropp
Copy link
Contributor

I think in version 6 we should drop support for serializing interface properties

@danielmarbach
Copy link
Contributor

Can you explain why?

Am Samstag, 2. Mai 2015 schrieb Simon Cropp :

I think in version 6 we should drop support for serializing interface
properties


Reply to this email directly or view it on GitHub
#2717 (comment)
.

Daniel Marbach

Solution Architect, Particular Software

Email: daniel.marbach@particular.net

Web: www.particular.net
http://t.signauxneuf.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJN7t5XX4RzDjlVS9QB88pTc_dW3Ljg7x56dWyBdgBXs402?t=http%3A%2F%2Fwww.particular.net%2F&si=4896787407044608&pi=33cc6202-1f31-4040-8d6c-e70641f44bba

@andreasohlund
Copy link
Member

I can't come up with a single reason to support interface properties so +1
to what @SimonCropp said

On Sat, May 2, 2015 at 7:24 AM, Daniel Marbach notifications@github.com
wrote:

Can you explain why?

Am Samstag, 2. Mai 2015 schrieb Simon Cropp :

I think in version 6 we should drop support for serializing interface
properties


Reply to this email directly or view it on GitHub
<
#2717 (comment)

.

Daniel Marbach

Solution Architect, Particular Software

Email: daniel.marbach@particular.net

Web: www.particular.net
<
http://t.signauxneuf.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJN7t5XX4RzDjlVS9QB88pTc_dW3Ljg7x56dWyBdgBXs402?t=http%3A%2F%2Fwww.particular.net%2F&si=4896787407044608&pi=33cc6202-1f31-4040-8d6c-e70641f44bba


Reply to this email directly or view it on GitHub
#2717 (comment)
.

@SimonCropp
Copy link
Contributor

Yeah there are reasons for supporting interfaces at the root level. But interfaces at the property level is a recipe for pain

@danielmarbach
Copy link
Contributor

Aaah! Now I got it! Your talking about

IBar Bar { get; set; }

Sorry you lost me for a second
+1 then

Am Samstag, 2. Mai 2015 schrieb Simon Cropp :

Yeah there are reasons for supporting interfaces at the root level. But
interfaces at the property level is a recipe for pain

-----Original Message-----
From: "Andreas Öhlund" <notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');>
Sent: ‎2/‎05/‎2015 8:06 PM
To: "Particular/NServiceBus" <NServiceBus@noreply.github.com
javascript:_e(%7B%7D,'cvml','NServiceBus@noreply.github.com');>
Cc: "Simon Cropp" <simon.cropp@gmail.com
javascript:_e(%7B%7D,'cvml','simon.cropp@gmail.com');>
Subject: Re: [NServiceBus] Interface inheritance breaks during
serializationwhen same property name is found in more than one interface
(#2717)

I can't come up with a single reason to support interface properties so +1
to what @SimonCropp said

On Sat, May 2, 2015 at 7:24 AM, Daniel Marbach <notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');>
wrote:

Can you explain why?

Am Samstag, 2. Mai 2015 schrieb Simon Cropp :

I think in version 6 we should drop support for serializing interface
properties


Reply to this email directly or view it on GitHub
<

#2717 (comment)

.

Daniel Marbach

Solution Architect, Particular Software

Email: daniel.marbach@particular.net
javascript:_e(%7B%7D,'cvml','daniel.marbach@particular.net');

Web: www.particular.net
<

http://t.signauxneuf.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJN7t5XX4RzDjlVS9QB88pTc_dW3Ljg7x56dWyBdgBXs402?t=http%3A%2F%2Fwww.particular.net%2F&si=4896787407044608&pi=33cc6202-1f31-4040-8d6c-e70641f44bba


Reply to this email directly or view it on GitHub
<
#2717 (comment)

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#2717 (comment)
.

Daniel Marbach

Solution Architect, Particular Software

Email: daniel.marbach@particular.net

Web: www.particular.net
http://t.signauxneuf.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJN7t5XX4RzDjlVS9QB88pTc_dW3Ljg7x56dWyBdgBXs402?t=http%3A%2F%2Fwww.particular.net%2F&si=4896787407044608&pi=33cc6202-1f31-4040-8d6c-e70641f44bba

@johnsimons
Copy link
Member

@SeanFeldman if i'm not mistaken, you need to create a support-5.3 branch and then merge a release-5.3 branch into it.

@johnsimons
Copy link
Member

I think in version 6 we should drop support for serializing interface properties

@SimonCropp can you raise a different issue

@andreasohlund
Copy link
Member

@SeanFeldman what's the status here? (no need for a support branch btw, master is still targeting v5

SeanFeldman added a commit that referenced this issue Aug 4, 2015
@SeanFeldman SeanFeldman modified the milestones: 5.2.4, 5.3.0 Aug 4, 2015
@SeanFeldman
Copy link
Contributor Author

will go out as hotfix-5.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants