2009년 1월 6일 화요일

Exception :System.Deployment.Application.TrustNotGranted

Trust not granted xbap 웹 퍼블리쉬 문제
----------------------------------------

XBap 어플리케이션은 기본 권한 범위를 넘어서는 권한을 이용하게 되면,
사용자의 동의를 구하지 않고 보안예외가 발생합니다.
(물론 디버깅시에는 전체 신뢰 모드이기 때문에 문제가 없습니다만, 사실 이 부분은 개발 당시에 해당 부분에 대한 제약을 먼저 걸었어야 하는데 ;;;)
http://msdn2.microsoft.com/en-us/library/aa480229.aspx 에서
WPF의 보안 샌드 박스에 관련한 내용을 찾으실 수 있습니다.
굳이 Xbap에서 기본 권한을 넘어서는 어플리케이션을 작성하셔야만 한다면, 인증서를 이용하여 신뢰가능한 어플리케이션으로 배포하는 것을 권장합니다.
인증서를 사용하지 않는 방법으로는 CD-ROM 형식을 지원하는 것으로 게시하시고 해당 파일들을 CD로 배포하시면, 기본 권한 영역이 상승된 까닭으로 정상적으로 동작할 수 있습니다
---------------------------------------------------
http://www.geekpedia.com/Thread32867_Trust-Not-Granted-Error-Full-Trust-WPF-Web-App-On-A-Corporate.html

I'm trying to create a WPF Web Application, that will ultimately runon a corporate network - in otherwords the XBAP will be executed froma network share.When I execute the XBAP from the remote share I get the followingexceptions:ERROR SUMMARYBelow is a summary of the errors, details of these errors are listedlater in the log.* An exception occurred while determining trust. Following failuremessages were detected:+ User has refused to grant required permissions to the application.* An exception occurred while downloading the application. Followingfailure messages were detected:+ The AssertApplicationRequirements method failed. The applicationcannot be committed.The first thing I did was to create a public/private key pair:makecert.exe -sv MyKey.pvk -n "CN=Mine" MyKey.cerThen from this I created a PFX Certificate:pvk2pfx.exe -pvk MyKey.pvk -spc MyKey.cer -pfx MyKey.pfx -poMyPasswordI then created a new Windows Presentation Foundation Web Applicationin Visual Studio 2008.Next I set the properties for the application:Signing:Tick "Sign the ClickOnce manifests"Select From File - I select the certificate file I've just made.Tick "Sign the assembly"Security:Tick "Enable ClickOnce Security Settings"Check "This is a full trust application"Publish:Publish Location - this is folder on the local hard drive that isshared on the network.I build and publish the applicaiton. It works fine on the localmachine.Move to 'remote' machine on the corporate network.Copy and install the certificate file I made earlier and store it inthe "Trusted Publishers" folder.Browse to the development machines "publish" folder. Double click theXBAP file. I'm presented with the "Trust Not Granted" - "Theapplication cannot be deployed because it is not trusted and possiblyunsafe." error. On clicking "Open Error Log" I get the exceptionswritten above.Any help would be appreciated as it's driving me nuts!Thanks in advanceMatt

댓글 없음: