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.

Lacking details for how to use App Settings

See original GitHub issue

Description

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):

  1. 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”? 😉
  2. 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.
  3. 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:open
  • Created 2 years ago
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
binaryn3xuscommented, Feb 5, 2022

@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 used Secret_ 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: image

Documentation v2.0 image

2reactions
dansiegelcommented, Aug 30, 2021

There is a known issue with Code Gen that you need to close and reopen the project for intellisense to pick it up

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I read/write app.config settings at runtime without ...
I'm looking for a way to store application or machine level settings that can be written to at runtime using Application Settings.
Read more >
Essential .NET 6 app settings tips... master developer and ...
In this tutorial, you will learn how to configure a .NET 6 application to work with either environment-specific settings, or, ...
Read more >
App settings reference for Azure Functions
Reference documentation for the Azure Functions app settings or environment variables used to configure functions apps.
Read more >
Change your Google app settings - Android
You can change your settings for the Google app, including settings for voice search, past searches, SafeSearch, and notifications. Some Google app settings...
Read more >
Intro to AppSettings in .NET Core - YouTube
If you are just using appsettings.json, you are really missing out. ... Server App 6:33 - AppSettings intro 8:45 - Why to use...
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