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

UpsertItemStreamAsync and CreateItemStreamAsync throw System.Configuration.ConfigurationException on Android #1267

Closed
1iveowl opened this issue Mar 9, 2020 · 1 comment

Comments

@1iveowl
Copy link

1iveowl commented Mar 9, 2020

Describe the bug

UpsertItemStreamAsync and CreateItemStreamAsync will throw System.Configuration.ConfigurationException with Xamarin on Android (emulator and device).

ReadItemStreamAsync works fine is same project.

To Reproduce

Try to use UpsertItemStreamAsync or CreateItemStreamAsync on an Android device or an Android emulator.

The innermost exception says:

Operation is not supported on this platform

The source of the exception is: System.Configuration.ConfigurationManager

From the API documentation It seems that System.Configuration.ConfigurationManager is supported on Xamarin.Mac but not on the other Xamarin platforms.

Others are having issues withSystem.Configuration.ConfigurationManager on Android too:

Work-around

Simply ignoring/swallowing the ConfigurationException seem to work, as documents are in fact being Upserted or Created in Cosmos DB just fine, despite the exception thrown.

Of course doing so feels rather hacky and is uncomfortable making one wonder about hidden side-effects.

Expected behavior
No such exception is thrown on iOS in the same project, although it does not seem to be supported.

Environment summary
SDK Version: 3.6.0 and 3.7.0-preview.
Android Version: 9.0 (Api level 28-Pie)
Visual Studio 2019: 16.4.5
.NET Core: 3.1.102.

@dos-ise
Copy link

dos-ise commented Feb 8, 2022

I have a netstandard library that heavily uses ConfigurationManager and throws this exception.
Since I am not developer of this library is it possible to do anything else. The exception throws immediately when using this lib.

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

No branches or pull requests

3 participants