Lacking details for how to use App Settings
See original GitHub issueDescription
The manual for App settings (this one) contains obvious errors and also lacks instructions on how to actually use app settings. You have internalized your library so much that you no longer realize what other people (who encounter Mobile.BuildTools for the first time) don’t yet know 😉.
From reading the (incomplete) docs, this is what I’ve tried to use App settings (without success - no Helper class is generated, and I cannot use it from my code):
- Create a
appsettings.json
file in the root of my shared netstandard project (I’m assuming this location, because the sentence here just stops… “The Mobile.BuildTools is smart, we look for the appsettings.json in the p” … what is a “p”? 😉 - Create a
buildtools.json
file in the same project’s root (again, assuming…) with some content. The manual sometimes uses"appSettings"
and sometimes"projectSecrets"
as root key, I’m not sure which one I should use. - Add Mobile.BuildTools and Mobile.BuildTools.Configuration nuget packages to my shared project
For testing, my buildtools.json
file has this as content (where I am not sure if the AwesomeApp
part is an arbitrary string, or if it relates to something in my code base):
{
"$schema": "https://mobilebuildtools.com/schemas/v2/buildtools.schema.json",
"appSettings": {
"AwesomeApp": [
{
"properties": [
{
"name": "AppCenterAppId",
"type": "String"
}
]
}
]
}
}
I reckon I need to create additional files to tell MSBuild to actually generate something.
Disclaimer: I’m rather new to the C# and Xamarin world.
Issue Analytics
- State:
- Created 2 years ago
- Comments:25 (8 by maintainers)
Top GitHub Comments
@dansiegel I figured out my issue.
The documentation for Continuous Integration says one thing, but the code hints say another. I just happened to see the code hint while tinkering to get this working. Code hint says it uses
BuildTools_
prefix as the default, while documentation says it usedSecret_
as the default. Once I updated my environment variables in AppCenter, it worked great. So as a courtesy, I thought I would come back here and share my findings for you and anyone who might be struggling with the same issue in the future.Code Hint:
Documentation v2.0
There is a known issue with Code Gen that you need to close and reopen the project for intellisense to pick it up