I need to host the .NET runtime in an unmanaged process. I have code that works to load the runtime through COM, and I can load assemblies in AppDomain and execute the code just fine.
However, I ran into problems with applications hosted on a network share and must change the application policy to make them execute, which is not an option. So what I would like to do is set the permission level for the main AppDomain application to run without restrictions.
Can someone provide an example of how to set the AppDomain policy level? I cannot figure out how to create the required classes from unmanaged code in order to create a PolicyLevel and related objects and set a policy. Basically, I donβt know what the / namespace links that I need to make this work from the C ++ code that I use.
Here is the code that I have at the moment:
I took the sample code (commented), which seems to do what I need, but I canβt figure out what lib / include links I need to make the type links for PermissionSet and PolicyLevel work.
Any ideas that are much appreciated ...
Rick strahl
source share