WCF & Linking

Hey guys. I was wondering if anyone ran across this and if they were able to fix it.

I am trying to create a RELEASE package for my application to hand out to beta testers and in the process of creating this package, I ran into some weird issues regarding the SVCUTIL generated WCF proxy's. If I had linking turned on the classes that were used during the synchronization process were determined via reflection and with linking turned out would invariably generate an error that there needed to be a getter and setting on a property for the class being used. This would eventually cause the application to fail and crash. After much back and forth, hair pulling, banging my head against the wall and reading stack overflow, I came across an similar issue with MonoTouch, and based on that post I determined that the issue was directly related to the linking, and after turning off all linking, poof, everything magically started working.

I know that there is a way using attributes to get the linking working properly, but that requires quite a bit of work in adding attributes to the automatically generated classes. Which is NOT an ideal situation, mainly because if I need to regenerate those classes, all those changes are gone.

So, does anyone have any other solutions to this issue, or should I just leave everything as is and stick with the 22MB APK file that is generated for my application?

Thanks.

Chaitanya Marvici

Posts

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    if I had linking turned on

    Which linking? There are two linker settings: Link SDK Assemblies, and Link All Assemblies. The Link SDK Assemblies settings should not be linking/altering your WCF proxies. Link All Assemblies will, and is affectionately known as the "please break my code" option.

  • Jonathan,
    Thanks for your response. After reading your response, I realized that I was having problems with the "Link All Assemblies" option, but couldn't remember if I had tried the other linking option, so I went back and recompiled with the "Link SDK Assemblies" option. Sure enough THAT worked. Choosing that option got the APK down from 22MB to 9MB, so I think that it's going to work just fine!

    Thanks!

    Chico Marvici

Sign In or Register to comment.