none
AD RMS SDK 2.1 "The system cannot find the file specified"

    Question

  • I'm new at RMS and I'm developing an application to rms encrypt some documents.

    I'm trying to get started with the interop example posted some time ago, but when I run the application, it fails with the following error:

    InformationProtectionException was unhandled.

    The system cannot find the file specified. HRESULT: 0x80070002

    At no point it says which file it's trying to find. This is part of the code I'm trying to run:

    SafeNativeMethods.IpcInitialize();
    SafeNativeMethods.IpcGetTemplateList(null, true, true, false, true, null, null);

    The initialization goes ok, but when I try to get the templates (or the issuers via SafeNativeMethods.IpcGetTemplateIssuerList), it throws the file not found exception.

    Has anybody faced this issue? What am I doing wrong?

    Thank you all in advance!
    Alejandro

    Tuesday, July 23, 2013 7:30 PM

All replies

  • Hi,

    I'm also new to AD RMS and trying to get started with the interop example. I too am getting the EXACT SAME ERROR - The system cannot find the file specified. HRESULT: 0x80070002 - when I try to run the code below:

    I try to run this statement: Collection<TemplateInfo> 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;
    	}
    }

    Here's my stack trace:

    The system cannot find the file specified. HRESULT: 0x80070002
       at Microsoft.InformationProtectionAndControl.SafeNativeMethods.ThrowOnErrorCode(Int32 hrError) in c:\Microsoft.InformationProtectionAndControl\SafeNativeMethods.cs:line 1678
       at 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
       at IPC.GetTemplates() in c:\IPC.cs

    Please let me know if you have resolved this error or if you can find any managed code samples for AD RMS. 

    Thanks

    Thursday, July 25, 2013 12:40 PM
  • Hi Alejandro,

    Did you check to make sure your certificate had not been expired? I know the one that comes with the sample has an expired certificate.  Although, this did not solve my problem maybe it could help with yours

    Thursday, July 25, 2013 2:49 PM
  • Hi,

    Did you find any issues?

    i had the same problem for three days now.

    Wednesday, April 02, 2014 5:26 PM
  • I faced same exact issue, and found out that, while instructions here mentions to copy ipcsecproc_isv.dll and ipcsecproc_ssp_isv.dll from %MSIPCSDKDIR%\bin\x64 to C:\Program Files\Active Directory Rights Management Services Client 2.1, the program was looking for C:\Program Files (x86)\Active Directory Rights Management Services Client 2.1,

    As Russinovich says, when in doubt, procmon :-)


    Tuesday, April 15, 2014 4:49 PM