Search code examples
c#.netresourcesembedded-resourcerc

"File Not Found" while trying to compile an RC file (probably dumb mistake)


Following these steps for adding a UAC manifest to my C# project embedded as a resource.

Step 1 works fine, I create the RC file in my project as a simple text file as described.

#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>"
}

Then using the Visual Studio Command Prompt, I get the following output at step 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

I assume this is something quite dumb, right?


Solution

  • No repro, I don't see anything wrong. The C# compiler already embeds a UAC manifest into the assembly since VS2008 (possibly VS2005 SP1 for Vista). If you want to modify it then use Project + Add New Item and select the "Application Manifest File" item template.