Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Configure Evidence for the default AppDomain when launching from an unmanaged C++ application

$
0
0

I have an unmanaged C++ app that makes calls into managed code libraries written in both C# and C++. One of the libraries uses classes from System.IO.Packaging and certain API's are throwing IsolatedStorageException's. The full detail of the issue is explained in the link below, but the gist of the problem is that my unmanaged app does not have any security evidence configured, which is causing the exception under certain conditions.

http://rekiwi.blogspot.com/2008/12/unable-to-determine-identity-of-domain.html

Is it possible to configure Evidence for the default AppDomain from an unmanaged application? Through code or maybe through the .exe.config file? The general suggestion seems to be to create a new AppDomain, which I'd rather avoid doing just to solve what I thought was a minor problem.

I created a sample app to illustrate the issue. I created an unmanaged MFC app that calls into a managed C++ library. The library just shows a message displaying the security evidence. The message show blank. If I turn on "Common Language Runtime Support (/clr)" in the MFC app, I get Evidence configured (see below) and no IsolatedStorageException's.

Turning on CLR in my app is not an option, so I'm hoping there's another way to do this. Any help would be appreciated.

thanks,

<System.Security.Policy.Url version="1">
<Url>file:///C:\ExcelTest\Debug\MFCApp.exe</Url>
</System.Security.Policy.Url>

<System.Security.Policy.Zone version="1">
<Zone>MyComputer</Zone>
</System.Security.Policy.Zone>

<System.Security.Policy.Hash version="2">
<hash algorithm="SHA1"
value="F6A1F0390C233314F3FAD36A1AC4C462FDE54407"/>
<hash algorithm="SHA256"
value="865B26A88EFA1EF49AF961390C3ACDD638041102F0CEDA361755D16F214432A3"/>
<hash algorithm="MD5"
value="17A180BD7569F426918C8487E479B965"/>
</System.Security.Policy.Hash>



Viewing all articles
Browse latest Browse all 1710

Trending Articles