question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration system throws `PlatformNotSupportedException` on Xamarin Android.

See original GitHub issue

Description

Configuration system throws PlatformNotSupportedException on Xamarin Android.

Complete minimal example reproducing the issue

3.Should().BeGreaterThan(4); // Probably any failing test?

Expected behavior:

The normal assertion failure process

Actual behavior:

The following Exception is thrown:

System.PlatformNotSupportedException : Operation is not supported on this platform.
 		  at System.Configuration.ConfigurationManager.PrepareConfigSystem () [0x0001a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0 
 		  at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0 
 		  at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0 
		  at FluentAssertions.Common.AppSettingsConfigurationStore.GetSetting (System.String name) [0x00000] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Common.Configuration.get_ValueFormatterAssembly () [0x00008] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Common.Configuration.DetermineFormatterDetectionMode () [0x00000] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Common.Configuration.get_ValueFormatterDetectionMode () [0x0001e] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Formatting.AttributeBasedFormatter.get_IsScanningEnabled () [0x00005] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Formatting.AttributeBasedFormatter.CanHandle (System.Object value) [0x00000] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Formatting.Formatter+<>c__DisplayClass7_0.<Format>b__0 (FluentAssertions.Formatting.IValueFormatter f) [0x00000] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) [0x0003f] in <15cecf952ca44136ad5b83afa233f6f3>:0 
 		  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00000] in <15cecf952ca44136ad5b83afa233f6f3>:0 
 		  at FluentAssertions.Formatting.Formatter.Format (System.Object value, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) [0x00012] in <d52b982f9eb24747b8fd904dff0631fe>:0 
		  at FluentAssertions.Formatting.Formatter.ToString (System.Object value, System.Boolean useLineBreaks) [0x00054] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Execution.MessageBuilder.<FormatArgumentPlaceholders>b__6_0 (System.Object a) [0x00000] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at System.Linq.Enumerable+SelectArrayIterator`2[TSource,TResult].ToArray () [0x00012] in <15cecf952ca44136ad5b83afa233f6f3>:0 
		  at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <15cecf952ca44136ad5b83afa233f6f3>:0 
 		  at FluentAssertions.Execution.MessageBuilder.FormatArgumentPlaceholders (System.String failureMessage, System.Object[] failureArgs) [0x00012] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Execution.MessageBuilder.Build (System.String message, System.Object[] messageArgs, System.String reason, FluentAssertions.Execution.ContextDataItems contextData, System.String identifier, System.String fallbackIdentifier) [0x00036] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Execution.AssertionScope+<>c__DisplayClass30_0.<FailWith>b__0 () [0x00055] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Execution.AssertionScope.FailWith (System.Func`1[TResult] failReasonFunc) [0x0001a] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Execution.AssertionScope.FailWith (System.Func`1[TResult] failReasonFunc) [0x00014] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Execution.AssertionScope.FailWith (System.String message, System.Object[] args) [0x00014] in <d52b982f9eb24747b8fd904dff0631fe>:0 
 		  at FluentAssertions.Numeric.NumericAssertions`1[T].BeGreaterThan (T expected, System.String because, System.Object[] becauseArgs) [0x0004c] in <d52b982f9eb24747b8fd904dff0631fe>:0 

Versions

FluentAssertions 5.9.0 Xamarin.Android SDK 9.1.7.0 (HEAD/ba9da7a76) Emulator 27.3.9-4899998 API 27 (x86)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
borrrdencommented, Sep 25, 2019

I imagine it compiles because of the odd Microsoft policy that it is acceptable for things to be part of the .NET Standard, but then throw not supported exceptions on platforms that are not applicable…

0reactions
jnyrupcommented, Jan 2, 2020

Fixed in #1210, which is included in 5.10.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin Android application is not able to connect to MVC ...
The Issue I am facing is that the Android application is throwing an exception while connecting with MVC core web API. And here...
Read more >
Security - PlatformNotSupportedException (Operation is ...
I am using E4098 to connect the Xamarin app to the XPO/XAF back-end. This code works fine in Android app and a successful...
Read more >
AndroidApp and MySqlConnection didn't work connection. ...
ConfigurationManager class, which isn't supported on Xamarin Android. ... System.PlatformNotSupportedException: Operation is not supported ...
Read more >
System.PlatformNotSupportedException when running ...
Hey, we have problems when running a module inside Xamarin-Forms on iOS. We have the following code: var application = AbpApplicationFactory ...
Read more >
UWP app throws System.PlatformNotSupportedException ...
This only occurs when Build option 'Compile with .NET Native tool chain' is enabled, which is the preferred setting for Release builds. My ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found