Skip to content

Section and key variables in appsettings.json file can't be read in the Linux environment #62886

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] [regression] [worked-in:17.10]

  • Visual Studio 2022 Community Version 17.10.3
  • Project Type: ASP.NET Core Web API
  • Problems
    : key values in the appsettings.json can't be loaded under the Linux environments
  1. injects an appsettings.json variables through constructor injection with IConfiguration
    private readonly IConfiguration _configuration;
    private string _myhost;
    public AuthController( ILogger<AuthController> logger, IConfiguration configuration){
    _logger = logger;
    _configuration = configuration;
    _myhost = _configuration.GetSection("GoogleAuth").GetValue<string>("TokenUri") ?? string.Empty;
    }

[HttpGet("test")]
public async Task<IActionResult> Test(){
_logger.LogInformation( $"... Google Auth Token URI : ==> {_myhost} " );
}

  1. Run with Debug mode in the local Windows machine runs ok.
    it produce the items in the debug console window in the appsettings.json file

  2. When the publish or debug build files are uploaded the Ubuntu Linux server machine,
    _logger can't display the items variable in the appsettings.json file

  • I suppose this problem showed from the version17.10.2 ???

  • I hope the VS will be right back to normal...


Original Comments

Feedback Bot on 6/21/2024, 02:18 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 6/25/2024, 05:43 AM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Author: Migration Bot 🤖The issue was created by a issue mover bot. The author may not be the actual author.Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issuearea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions