Saturday, September 9, 2017

RFLCT_Ambiguous when running UWP in release and using Autorest

This is one of those short stories...

TLDR;


If you get a RFLCT_Ambigous exception in your UWP app in Release configuration on the initialization of the autogenerated service client that Autorest created for you then simply update the Microsoft.NETCore.UniversalWindowsPlatform package.

The issue does not arise in debug mode.

Long version


I'm ashamed... I spent way to much time on this issue before I tried what I should've tried the first time I saw the error. 

Always update your nuget-packages before trying to solve an issue related to some other persons code. Oh, and always do so in a feature/bug branch or at least make sure you can roll stuff back. Things can go bad.

The issue at hand by the way was that some Attributes had been duplicated. And if you try to get an attribute by doing something like this:

 GetCustomAttribute(typeof(AssemblyFileVersionAttribute))

It might actually return multiple attributes. And a piece of code inside Microsoft.Rest.ClientRuntime didn't like this. It seems like attributes that makes no sense duplicating has been duplicated, like AssemblyFileVersion... Why would you like to have two of those.

Anyhow... I'm going to write a couple of hours of my clients bill now and tattoo "always update nuget packages first" on a close by colleague so I will remember it in the future.


Resources / sources


https://github.com/Azure/autorest/issues/1542

https://github.com/aspnet/EntityFrameworkCore/issues/6242

https://github.com/dotnet/corefx/issues/16769

1 comment:

  1. Splendid stuff! Looking forward to reading some more articles on your site

    ReplyDelete