active directory - AD RMS Managed Code Error The system cannot find the file specified. HRESULT: 0x80070002 -


i'm new active directory rights management services (ad rms) , i'm developing application use ad rms encrypt documents. i'm using interop example , error - system cannot find file specified. hresult: 0x80070002 - when try run code below:

i error when try run statement:

collection ipctemplates = ipc.gettemplates();

internal static class ipc {      static ipc()      {           safenativemethods.ipcinitialize();      }       public static collection<templateinfo> gettemplates()      {           collection<templateinfo> templates = null;            try           {                templates = safenativemethods.ipcgettemplatelist(null, true, true,                                 false, false, null, null);           }           catch (exception /*ex*/)           {               /* todo: add logging */               throw;            }            return templates;      } } 

stack trace:

the system cannot find file specified. hresult: 0x80070002 @ microsoft.informationprotectionandcontrol.safenativemethods.throwonerrorcode(int32 hrerror) in c:\microsoft.informationprotectionandcontrol\safenativemethods.cs:line 1678 @ microsoft.informationprotectionandcontrol.safenativemethods.ipcgettemplatelist(connectioninfo connectioninfo, boolean forcedownload, boolean suppressui, boolean offline, boolean hasuserconsent, form parentform, cultureinfo cultureinfo) in c:\microsoft.informationprotectionandcontrol\safenativemethods.cs:line 137 @ ipc.gettemplates() in c:\ipc.cs

also, have set post build event make sure manifest file gets created every time code compiled. application wcf service hosted in windows service. have simple console app works.

any in resolving error , ad rms examples using managed code appreciated :)

for else may run issue able resolve problem adding safenativemethods.ipcsetapimode(apimode.server); static constructor this:

static ipc()     {         safenativemethods.ipcinitialize();         safenativemethods.ipcsetapimode(apimode.server);     } 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -