2017-09-28 15 views
0

Visual Studio .NET 2003에서 만든 레거시 콘솔 응용 프로그램이 있습니다. 빌드시 생성 된 .exe 내의 매니페스트 파일을 성공없이 포함하려고합니다. Windows 7에서 UAC가 발생하지 않도록하려면 내 앱이 시작될 때 팝업이 필요합니다.C# mt.exe v1.0.0.0을 사용하여 .exe 내 매니페스트 파일 포함

그래서 내 매니페스트 파일은 그 이하 MyTestApp.exe.manifest라고되어

다음
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
    <assemblyIdentity version="1.0.0.0" 
    processorArchitecture="X86" 
    name="IsUserAdmin" 
    type="win32"/> 
    <description>SDPUpdater for ServiDirPlus</description> 
    <!-- Identify the application security requirements. --> 
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> 
    <security> 
     <requestedPrivileges> 
     <requestedExecutionLevel 
      level="requireAdministrator" 
      uiAccess="false"/> 
     </requestedPrivileges> 
    </security> 
    </trustInfo> 
</assembly> 

의 Visual Studio .NET 2003에서, 빌드 후 행동에 내가 다음 명령을 쓰기 :

"C : \ Program Files (x86) \ Microsoft Visual Studio .NET 2003 \ Common7 \ Tools \ Bin \ winnt \ mt.exe "-manifest"$ (ProjectDir) $ (TargetFileName) .manifest "

다음을 고려하십시오.

01 23,

내 매니페스트 파일 MyTestApp.exe.manifest은 C : \ MyProjects \ ConsoleApps \ MyTestApp

\ 그러나 오류 아래에 나타납니다 :

Performing Post-Build Event... 
Microsoft (R) Side-By-Side Manifest Tool 1.0.0.0 
Copyright (C) Microsoft Corporation 2000-2001. All Rights Reserved. 

Nothing to do! 
Modes of operation: 
    -hashupdate   Update hashes of member files 
    -makecdfs   Generate CDF files to make catalogs 
    -verbose   Disply piles of debugging information 

Modifiers: 
    -manifest <foo.man> The name of the manifest to work with 

Normal usage: mt.exe -hashupdate -makecdfs -manifest foo.man 

Project error: A tool returned an error code from the build event 

Post-Build Event failed 

가 나는 것으로하여 Mt.exe을 나타 내기 위해 생각 내 매니페스트 파일은 MyTestApp.exe 내에 포함되어야하지만 mt.exe v1.0.0.0에만 1 개의 수정 자 (매니페스트)가 있기 때문에 MyTestApp.exe 파일을 나타내는 방법이 제공되지 않기 때문에 어떻게되는지 모르겠습니다.

+1

14 세가 너무 늦었습니다. VS 버전을 업데이트해야 할 좋은 이유를 발견했습니다. –

답변

0

내가 사용하고 Mt.exe에 (마이크로 소프트 (R) 매니페스트 도구 버전 5.2.3790.2075) 및 사후 빌드에서이 줄을 사용 :

"C : \ 프로그램 파일 \은 Microsoft SDKs \ 윈도우 \ v6.0A \ Bin \ mt.exe "-manifest"$ (ProjectDir) $ (TargetFileName) .manifest "-outputresource : $ (TargetFileName); # 1

이제 컴파일됩니다. 내가 콘솔 응용 프로그램을 실행하면

는 UAC를 팝업 알림이 나타나는 계속 :

지금, 나는 또 다른 문제가 있습니다.

내 콘솔 앱이 C : \ Program Files \에있는 폴더에 wrting하고 있습니다.

하지만 다른 게시물을 여는 것이 좋습니다. 이 문제가 해결되었습니다.