Smartphone device debugging problem with VS 2005

I have just setup VS 2005 beta 2 and I'm having trouble debugging native C++ apps on my smartphone device (even the simple one created by the New Project wizard). The error I get is:

Unable to start program '%CSIDL_PROGRAM_FILES%\TestApp\TestApp.exe'.
Operation not supported. Unknown error: 0x89731102.

Obviously I can't find any info about error 0x89731102.

Now, I can debug on the emulator, both for smartphone and pocket pc, and I can also debug on my pocket pc device. I can also debug on the smartphone device with EVC 4 from the same machine so I know the phone itself is setup correctly (all the right certificates and whatnot). *And* I can debug C# Compact Framework apps on the device with VS 2005.

Any ideas anybody

Thanks in advance for any help with this.

Regards,
Andrew.


Answer this question

Smartphone device debugging problem with VS 2005

  • Mordy

    Hi Daniel & Andrew,
    This is a security certificate issue.  The VS-Devices binaries are not signed with a certificate on your device, specifically "edm.exe".  You should be able to install the appropriate certificate by copying  "<install root>\smartdevices\sdk\sdktools\sdkcerts.cab" to your device, and manually installing the cab. 

    If you copy the file to "\windows\start menu" you should be able to click on the cab from the start menu on the device.

    eVC uses a different certificate, and managed debugging does not require the cert.

    Sorry for the bad error message.  We cleaned up the error messages for RTM, but we couldn't get the fix ready in time for Beta 2.

    Please let us know if this solve your problem!

    Rich Hanbidge - VS-Devices, Microsoft
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Jimig

    Rich and Andrew,

    Now it seems as if the debugging finally works! I guess the phone needed a restart after I added the certificate/s.

    I guess it is the certificate I got from edm.exe that did the trick, right If I understand things correctly, the certificates needed from sdktestcerts.xml gets transferred to the certificate store when you deploy your code to the phone (if you have entered things correctly in the Authenticode signing tab).

    I don't know if everyone's familiar with handling certificates and using rapiconfig. If not, here's a short guide on how to solve this (Win2k):

    At first you need to obtain the certificate:

    * Select "Properties" on <install root>\smartdevices\Debugger\target\wce400\armv4\edm.exe
    * Go to the Digital signatures-tab. Click on Information, Show Certificate and choose the Information-tab. Choose to save the certificate to file using Base 64-encoding.

    Then, the thumb print for the certificate:

    * The thumb print can be found in the same tab as you chose to save the certificate to file. Simply find the "Thumb print"-field.

    Now, create an Xml-file that looks like this:

    <wap-provisioningdoc>
        <characteristic type="CertificateStore">
            <characteristic type="Privileged Execution Trust Authorities">
                <characteristic type="{Enter certificate SHA-1 thumbprint in hexadecimal here}">
                    <parm name="EncodedCertificate" value="{Enter base64 encoded X.509 certificate here}" />
                    <parm name="Role" value="255" />
                </characteristic>
            </characteristic>
        </characteristic>
    </wap-provisioningdoc>

    Simply cut and paste the text in the certificate file that is inside -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- to the correct place in the Xml-file. Remember to remove the newlines so the certificate is on one line only.

    Also, cut and paste the thumbprint to the correct place as well, and remove the white spaces.

    * Run rapiconfig /p yourxmlfile.xml
    * Restart your phone

    Rich, can I get an OK from you that this is a correct way to make debugging work on the Smartphone 2003 :-)  Please adjust or add things that's not correct or left out.

    Regards,
    Daniel

  • Cha Chunchadatharn

    Rich,

    thanks for your reply.

    I don't have the cab file you mention on my computer. Does it come with an upgrade or something (not the Windows Mobile 5.0 Smartphone SDK I guess - since I still work with the Sp2003, I haven't installed it yet - but I will try with that)

    Instead, at first I tried running rapiconfig on the sdktestcerts.xml to copy the certificates in that file to the Smartphone. Still the same error message.

    Then I looked up the certificate that the edm.exe (<install root>\smartdevices\Debugger\target\wce400\armv4\edm.exe) is signed with, put it as a new certificate (to be put in the priviliged store - maybe this is the wrong place ) in the sdktestcerts.xml, and ran rapiconfig. Still the same error message.

    Any ideas on what I should try instead

    Regards,
    Daniel

  • Anthony Rizzo

    Hi,

    Copying the Smartphone 2005 SdkCerts.cab file to the 2003 phone and then running it works for me after a power cycle.

    Is there a new release (after Beta 2) in which all these problems are fixed

    Ian.

  • armo2006

    Can you please confirm that you do *not* see any sdkcerts.cab file in <install root>\smartdevices\sdk\sdktools\sdkcerts.cab

    Typically this would be in "C:\Program Files\Microsoft Visual Studio 8\smartdevices\sdk\sdktools\sdkcerts.cab"

    If you do have this file then please follow Rich's comments above to sign edm.exe.

    If you do not have this file as a part of Visual Studio install then there might be a installation issue.

  • Limmer

    I've got the same problem. Anyone at MS knows what causes this

    Regards,
    Daniel

  • Johnny P

    Rich & Daniel,

    There is an sdkcerts.cab file located in the Windows Mobile 5.0 SDK, but installing this doesn't seem to help - I guess the certificates are different.

    Andrew.

  • Ido Flatow

    Hi Rich,

    I have developed a demo app for Pocket PC Mobile 5.0 and want to distribute it to others to run on their PPCs. Is it OK for me to redistribute sdkcerts.cab from the VS2005 PPC SDK in my installation zip file

    Thanks,

    Charlie C.


  • antonioa - msft

    Hi Rich,

    Thanks, but like Daniel I don't have sdkcerts.cab. There does appear to be a certificate, Microsoft_Visual_Studio_Remote_Tools.cer - does this have anything to do with it

    Thanks for your help,
    Andrew.

  • Gabriel Mendez

    I can confirm this works for me too. It makes sense really - now that we know the problem is due to the certificate for edm.exe not being on the device, all we're doing is installing that certificate. Don't understand why the phone needs restarting though, but never mind.

    Thanks Daniel.

    Andrew.


  • Tej62007

    Hi Rich,

       I tried installing the sdkcerts.cab file after copying it to "\windows\start menu" directory on the device.

    I'm getting the following errror which installation:
    "Installation was unsuccessful. The program or setting cannot be installed because it does not have sufficient system permissions."

    Could you please let me know what is the problem

    Configuration:
    VS 2005 Beta 2
    Windows Mobile 5.0 Prerelease from HTC Tornado
    Windows XP SP2

    thank you in advance



  • Smartphone device debugging problem with VS 2005