-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve environment variable debugging in the app model (#1746)
- Loading branch information
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/Aspire.Hosting/ApplicationModel/EnvironmentAnnotation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Diagnostics; | ||
|
||
namespace Aspire.Hosting.ApplicationModel; | ||
|
||
// The purpose of this type is to improve the debugging experience when inspecting environment variables set without callback. | ||
[DebuggerDisplay("Type = {GetType().Name,nq}, Name = {_name}, Value = {_value}")] | ||
internal class EnvironmentAnnotation : EnvironmentCallbackAnnotation | ||
{ | ||
private readonly string _name; | ||
private readonly string _value; | ||
|
||
public EnvironmentAnnotation(string name, string value) : base(name, () => value) | ||
{ | ||
_name = name; | ||
_value = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters