有没有办法从 C# 代码中读取 ApplicationManifest.xml 并检索值?

Is there a way to read ApplicationManifest.xml from C# code and retrieve values?

我很好奇有没有办法将一些值准确地(且仅)放入ApplicationManifest.xml文件,然后在 C# 代码中读取它们?

我知道可以在 ServiceManifest.xml 中定义一些变量,然后在 ApplicationManifest.xml 中添加一个特殊的覆盖部分,并使用 GetConfigurationPackageObject 方法检索这些值。这不是我想要的。

没有。应用程序参数是最接近的东西,但正如您所知,这些参数通过 ConfigOverrides 部分进行检测,并进入各个服务配置包中的 Settings.xml 文件。