The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
Android + iOS Maui Mobile.BuildTools.Configuration seems to work fine! Trying to initialise the configuration manager/register the dependency causes an exception for WinUI.
Full error message:
System.UnauthorizedAccessException: 'Access to the path 'C:\WINDOWS\system32\Configuration' is denied.'
Reproduction Steps
Steps to reproduce the behavior:
Add Mobile.BuildTools and Mobile.BuildTools.Configuration to a Maui project
Add your app.config files as raw MauiAssets
Register the ConfigurationManager instance with DI
In the platform specific Window's App.xaml.cs, call ConfigurationManager.Init(true);
Expected Behavior
The WinUI app launches and the groundwork for using Mobile.BuildTools is setup
Actual Behavior
The app crashes on startup with an exception:
Removing the config code and only registering the ConfigurationManager.Current dependency:
When I try debugging inside the library, it appears to be using the CommonConfigManager which I think is the .NET Standard code path (intended for console apps/servers?).
Well for starters WinUI isn't a supported or tested target. If you'd like to contribute to the project I'd be happy to have it support WinUI. But I can't promise timelines if you're waiting on me.
Description
Android + iOS Maui Mobile.BuildTools.Configuration seems to work fine! Trying to initialise the configuration manager/register the dependency causes an exception for WinUI.
Full error message:
System.UnauthorizedAccessException: 'Access to the path 'C:\WINDOWS\system32\Configuration' is denied.'
Reproduction Steps
Steps to reproduce the behavior:
Mobile.BuildTools
andMobile.BuildTools.Configuration
to a Maui projectapp.config
files as raw MauiAssetsApp.xaml.cs
, callConfigurationManager.Init(true);
Expected Behavior
The WinUI app launches and the groundwork for using Mobile.BuildTools is setup
Actual Behavior
The app crashes on startup with an exception:![image](https://user-images.githubusercontent.com/7528322/210813773-4ff33080-ca0e-4d7c-b305-720f48aa5c63.png)
Removing the config code and only registering the ConfigurationManager.Current dependency:![image](https://user-images.githubusercontent.com/7528322/210816551-95bf50c7-aeef-4a3d-936f-56dc61677faf.png)
When I try debugging inside the library, it appears to be using the![image](https://user-images.githubusercontent.com/7528322/210814185-4ec519d5-de2c-4dc2-84ca-ad8556a16341.png)
CommonConfigManager
which I think is the .NET Standard code path (intended for console apps/servers?).One theory I have is that the library doesn't know about WinUI TargetFramework (https://github.com/dansiegel/Mobile.BuildTools/blob/master/src/Mobile.BuildTools.Configuration/Mobile.BuildTools.Configuration.csproj#L42) and is therefore not invoking any of the UWP code (would the UWP code work for WinUI?).
Environment
Reproduction App
https://github.com/BurkusCat/MbtConfigurationWinUIException