如何在不使用Visual Studio的情况下自定义C#.NET Framework Manifest

问题描述 投票:0回答:1

我主要使用JetBrains Rider,它似乎缺少添加清单的选项(尽管我的Visual Studio安装神秘地缺少“Add Item”菜单下的“Application Manifest”)。

所以,我创建了app.manifest并用所需的XML填充它(在我的例子中,它是一个带有经典<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>的香草清单)......但它没有用。

我将构建操作更改为EmbeddedResource ...但它仍然无法正常工作。

我将文件重命名为sandbox.exe.manifest ......仍然没有!

如果我在文本编辑器中打开exe,我会看到两个清单 - 我的,默认的。

我错过了什么步骤?

rider
1个回答
1
投票

您必须在项目文件中指定清单文件名。打开相应的csproj文件(Solution Explorer -> select your project -> F4 \ Edit sources)并将下一行添加到全局属性组:

<ApplicationManifest>app.manifest</ApplicationManifest>

有关更多信息,您可以阅读以下问题:

How can I embed an configuration-specific manifest file in my c# app?

© www.soinside.com 2019 - 2024. All rights reserved.