Microsoft MVP성태의 닷넷 이야기
VS.NET IDE: 50. Orcas - UAC 설정 관련 [링크 복사], [링크+제목 복사],
조회: 25324
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

(시리즈 글이 8개 있습니다.)
VC++: 29. 필수 무결성 제어를 조절하는 방법(1) - Manifest 파일 이용
; https://www.sysnet.pe.kr/2/0/445

VC++: 30. 필수 무결성 제어를 조절하는 방법(2) - 직접 코딩
; https://www.sysnet.pe.kr/2/0/446

VS.NET IDE: 43. .NET에서의 필수 무결성 제어 조절하는 방법 - Manifest 파일 이용
; https://www.sysnet.pe.kr/2/0/450

VS.NET IDE: 50. Orcas - UAC 설정 관련
; https://www.sysnet.pe.kr/2/0/507

개발 환경 구성: 320. Visual Basic .NET 프로젝트에서 내장 Manifest 자원을 EXE 파일로부터 제거하는 방법
; https://www.sysnet.pe.kr/2/0/11228

VS.NET IDE: 122. 비주얼 스튜디오에서 관리자 권한을 요구하는 C# 콘솔 프로그램 제작
; https://www.sysnet.pe.kr/2/0/11318

개발 환경 구성: 572. .NET에서의 필수 무결성 제어 - 외부 Manifest 파일을 두는 방법
; https://www.sysnet.pe.kr/2/0/12634

VS.NET IDE: 181. Visual Studio - C/C++ 프로젝트에 application manifest 적용하는 방법
; https://www.sysnet.pe.kr/2/0/13304





Orcas - UAC 설정 관련


예전에 다음과 같은 글들을 남긴 적이 있었지요.

VC++ : 5. 신뢰도 등급을 조절하는 방법(1) - Manifest 파일 이용 
; https://www.sysnet.pe.kr/2/0/445

VC++ : 6. 신뢰도 등급을 조절하는 방법(2) - 직접 코딩 
; https://www.sysnet.pe.kr/2/0/446

VS.NET IDE : 5. .NET 에서의 신뢰도 등급을 조절하는 방법 - Manifest 파일 이용 
; https://www.sysnet.pe.kr/2/0/450

자... 이제 Orcas가 나왔습니다. 당연한 얘기겠지만, Orcas에서는 UAC를 위한 Manifest 설정을 편하게 할 수 있는 방법을 제공해 주고 있습니다.

먼저, VC++ 프로젝트에서는 어떻게 하는지 볼까요?

orcas_manifest_settings_1.png

간단하지요! 위와 같이 설정창을 통해서 "UAC Execution Level"을 직접 지정하는 것이 가능합니다.
음... 더 설명할 것이 없군요. ^^;

그럼, .NET 프로젝트에서는 어떻게 하는지 또 마저 살펴볼까요?
이 경우에는, 직접적인 프로젝트 설정창에서 제공해 주지 않고, 아래와 같이 "Application Manifest File" 유형의 항목을 추가하는 것에서 시작하게 됩니다.

orcas_manifest_settings_2.png

그러면, 프로젝트에 'app.manifest' 라는 파일이 생성되고 내용은 다음과 같습니다.

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" 
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!-- UAC Manifest Options
             If you want to change the Windows User Account Control level replace the 
             requestedExecutionLevel node with one of the following .
        <requestedExecutionLevel  level="asInvoker" />
        <requestedExecutionLevel  level="requireAdministrator" />
        <requestedExecutionLevel  level="highestAvailable" />
        -->
        <requestedExecutionLevel level="asInvoker" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</asmv1:assembly>

이렇게 설정하고 빌드를 하고 나면, 왠지 대상 폴더에 "{응용 프로그램 이름}.exe.manifest" 라는 파일이 생성될 거라 기대가 되는데요.

음... ^^; 생성이 안되는 군요. ".NET 에서의 신뢰도 등급 조정 - Manifest 파일 이용" 에서 설명했던 데로, 어쩔 수 없이 "Enable ClickOnce Security Settings" 항목을 체크해 둬야만 기대했던 대로 동작하게 됩니다.

요건 한번... 건의를 해봐야 겠습니다. ^^

[내용 변경: 2007-06-12]
닷넷 프로젝트의 app.manifest를 하는 부분에서 제가 모르고 글을 쓰게 되었습니다.
알고 보니, app.manifest가 app.config 처럼 빌드 후에 별도로 외부 manifest로 존재하는 것이 아니라, 리소스로써 이미 포함되어 있었습니다. 따라서, 정상적으로 동작하는 것입니다.
참고로, manifest 관련한 빌드 옵션은 프로젝트 속성 창의 "Application" 탭의 "Resources" 그룹 상자안에 있는 "Icon and manifest"의 "Manifest" 콤보박스에서 "{manifest 파일명}", "Embed manifest with default settings", "Create application without a manifest" 값들 중의 하나를 택할 수 있습니다.

위와 같은 사항들은 다음의 토픽을 보고 알게 되었습니다. ^^
UAC with .NET in Visual Studio 2008 
; https://docs.microsoft.com/en-us/archive/blogs/knom/uac-with-net-in-visual-studio-2008 

자... 그러고 보니, 외부 manifest 파일로 존재하도록 만드는 방법은 간단합니다. 왠지 아주 정석인 것 같은 방법은 아니지만.
1. "app.manifest" 파일을 "{응용 프로그램 실행 파일명}.manifest" 명으로 바꿉니다.
2. 속성창에서 "Copy to Output Directory" 값을 "Copy always 또는 Copy if newer"로 바꿉니다.
그럼, 된건가요? 이것으로, 리소스로 포함할 때와, 외부 파일로 빼고 싶은 때를 "Application" 탭에서 지정할 수 있게 되었습니다.



[이 토픽에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 4/7/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 76  77  78  79  80  81  [82]  83  84  85  86  87  88  89  90  ...
NoWriterDateCnt.TitleFile(s)
11887정성태5/8/201921482.NET Framework: 829. C# - yield 문을 사용할 수 있는 메서드의 조건
11886정성태5/7/201919279오류 유형: 534. mstest.exe 실행 시 "Visual Studio Enterprise is required to execute the test." 오류 [2]
11885정성태5/7/201916221오류 유형: 533. mstest.exe 실행 시 "File extension specified '.loadtest' is not a valid test extension." 오류 발생
11884정성태5/5/201921017.NET Framework: 828. C# DLL에서 Win32 C/C++처럼 dllexport 함수를 제공하는 방법 - 두 번째 이야기
11883정성태5/3/201926214.NET Framework: 827. C# - 인터넷 시간 서버로부터 받은 시간을 윈도우에 적용하는 방법파일 다운로드1
11882정성태5/2/201922494.NET Framework: 826. (번역글) .NET Internals Cookbook Part 11 - Various C# riddles파일 다운로드1
11881정성태4/28/201922615오류 유형: 532. .NET Core 프로젝트로 마이그레이션 시 "CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute" 오류 발생
11880정성태4/25/201918462오류 유형: 531. 이벤트 로그 오류 - Task Scheduling Error: m->NextScheduledSPRetry 1547, m->NextScheduledEvent 1547
11879정성태4/24/201926856.NET Framework: 825. (번역글) .NET Internals Cookbook Part 10 - Threads, Tasks, asynchronous code and others파일 다운로드2
11878정성태4/22/201922611.NET Framework: 824. (번역글) .NET Internals Cookbook Part 9 - Finalizers, queues, card tables and other GC stuff파일 다운로드1
11877정성태4/22/201922706.NET Framework: 823. (번역글) .NET Internals Cookbook Part 8 - C# gotchas파일 다운로드1
11876정성태4/21/201921731.NET Framework: 822. (번역글) .NET Internals Cookbook Part 7 - Word tearing, locking and others파일 다운로드1
11875정성태4/21/201922753오류 유형: 530. Visual Studo에서 .NET Core 프로젝트를 열 때 "One or more errors occurred." 오류 발생
11874정성태4/20/201922940.NET Framework: 821. (번역글) .NET Internals Cookbook Part 6 - Object internals파일 다운로드1
11873정성태4/19/201921433.NET Framework: 820. (번역글) .NET Internals Cookbook Part 5 - Methods, parameters, modifiers파일 다운로드1
11872정성태4/17/201922308.NET Framework: 819. (번역글) .NET Internals Cookbook Part 4 - Type members파일 다운로드1
11871정성태4/16/201920929.NET Framework: 818. (번역글) .NET Internals Cookbook Part 3 - Initialization tricks [3]파일 다운로드1
11870정성태4/16/201919208.NET Framework: 817. Process.Start로 실행한 콘솔 프로그램의 출력 결과를 얻는 방법파일 다운로드1
11869정성태4/15/201925034.NET Framework: 816. (번역글) .NET Internals Cookbook Part 2 - GC-related things [2]파일 다운로드2
11868정성태4/15/201921031.NET Framework: 815. CER(Constrained Execution Region)이란?파일 다운로드1
11867정성태4/15/201920179.NET Framework: 814. Critical Finalizer와 SafeHandle의 사용 의미파일 다운로드1
11866정성태4/9/201923318Windows: 159. 네트워크 공유 폴더(net use)에 대한 인증 정보는 언제까지 유효할까요?
11865정성태4/9/201919061오류 유형: 529. 제어판 - C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools is not accessible.
11864정성태4/9/201917828오류 유형: 528. '...' could be '0': this does not adhere to the specification for the function '...'
11863정성태4/9/201917697디버깅 기술: 127. windbg - .NET x64 EXE의 EntryPoint
11862정성태4/7/201920174개발 환경 구성: 437. .NET EXE의 ASLR 기능을 끄는 방법
... 76  77  78  79  80  81  [82]  83  84  85  86  87  88  89  90  ...