shinyorg / ConfigurationExtensions

Xamarin Configuration Sources (Android & iOS) for Microsoft.Extensions.Configuration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AddJsonPlatformBundle not working on iOS

benlings opened this issue · comments

I've added this to a Xamarin.Forms application:

<PackageReference Include="Shiny.Extensions.Configuration" Version="1.1.4" />

Then in the ShinyStartup subclass's ConfigureServices I call

           var config = new ConfigurationBuilder()
                .AddJsonPlatformBundle("appsettings.json", optional: false)
                .Build();

However, if I step into AddJsonPlatformBundle, the platform-specific code isn't called. It looks like the #if condition isn't being met.

image

This happens when building for iOS device + simulator, using Rider 2021.3.2 and Xamarin.iOS 15.4.0.0.

You have to have a compile target in order to get those sections to become part of the compiler. These get switched at compile time for the platform anyhow.

Please send a reproducible sample.

This has been resolved in the latest preview. Please provide a sample in the future.

@aritchie What is the status of this fix? v1.1.1 on NuGet seems to be the only non-preview version and is broken on iOS. Could we get a fixed version of v1.1.x or is there a workaround?

Also there continue to be preview builds published but no corresponding git commits in this repo that I can see, which makes me apprehensive about using a preview release without being able to see the source code. Thanks in advance for any solution to get iOS working for this.

It moved over to the main shinyorg/shiny repo several months ago and has received all bugfixes there.

@aritchie Ah good to know, thanks. That was not clear from this repo. I'd suggest archiving this repo and putting a note in the README.

Any indication on when the latest builds are expected to come out of preview?

I'm a busy guy and a lot of people use my stuff. There are lots of things I could be doing.

As to when it exits preview, I'll give the same answer I give everyone - when it is done.