リソースとして埋め込まれた C# プロジェクトに UAC マニフェストを追加するには、次の手順に従います。
ステップ 1 は正常に機能します。説明に従って、プロジェクトに RC ファイルを単純なテキスト ファイルとして作成します。
#include <winuser.h>
#define IDR_MANIFEST 1 // 2 for a DLL
IDR_MANIFEST RT_MANIFEST MOVEABLE PURE
{
"<assembly xmlns=""urn:schemas-microsoft-com:asm.v1"" manifestVersion=""1.0"">
<asmv3:trustInfo xmlns:asmv3=""urn:schemas-microsoft-com:asm.v3"">
<asmv3:security>
<asmv3:requestedPrivileges>
<asmv3:requestedExecutionLevel
level=""asInvoker""
uiAccess=""false"" />
</asmv3:requestedPrivileges>
</asmv3:security>
</asmv3:trustInfo>
</assembly>"
}
次に、Visual Studio コマンド プロンプトを使用して、手順 2 で次の出力を取得します。
c:\myproject>rc MyResourceFile.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation. All rights reserved.
ConfigurationManager.rc(4) : error RC2135 : file not found: 1
これはかなりばかげていると思いますよね?