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

System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize #1262

Closed
carldebilly opened this issue Feb 25, 2020 · 2 comments

Comments

@carldebilly
Copy link

Problem

Try to use FluentAssertions on a Xamarin project (Android), running in a custom-made test engine. While trying to assert something, I'm getting this error:

`System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize`
02-25 02:42:35.008 D/Mono    (18235): Assembly Ref addref FluentAssertions[0xdff7e940] -> System.Configuration.ConfigurationManager[0xdff7eee0]: 2
�[41m�[30mfail�[39m�[22m�[49m: Windows.UI.Core.CoreDispatcher[0]
      Dispatcher unhandled exception
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
  at System.Configuration.ClientConfigPaths..ctor (System.String exePath, System.Boolean includeUserConfig) [0x00050] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0 
  at System.Configuration.ClientConfigPaths.GetPaths (System.String exePath, System.Boolean includeUserConfig) [0x00018] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0 
  at System.Configuration.ClientConfigurationHost.get_ConfigPaths () [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0 
  at System.Configuration.ClientConfigurationHost.GetStreamName (System.String configPath) [0x0006d] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0 
  at System.Configuration.ClientConfigurationHost.02-25 02:42:41.664 I/mono-stdout(18235): �[41m�[30mfail�[39m�[22m�[49m: Windows.UI.Core.CoreDispatcher[0]

Complete minimal example reproducing the issue

Add FluentAssertions to any Xamarin project and try to assert something.

Expected behavior:

It should work on any netstandard platform. In this case it seems to be netstandard2.1.

Actual behavior:

The configuration doesn't seem to work. On platform without configuration it should fallback to default values.

Versions

  • Which version of Fluent Assertions are you using?
    5.6.0
  • Which .NET runtime and version are you targeting? E.g. .NET framework 4.6.1 or .NET Core 2.1.
    MonoAndroid 9.0

Additional Information

It's used in THIS PROJECT to run unit tests on all supported platforms (iOS, Android and Mono-Wasm).

@dennisdoomen
Copy link
Member

This was already fixed in 5.10. See #1210

@carldebilly
Copy link
Author

It works. Thanks!

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

No branches or pull requests

2 participants