locked
Problem Hosting HelloWorld Sample Application in IIS RRS feed

  • Question

  • Hi,

    I have mapped the Hello World sample given in the health vault sdk to my IIS
    While i browse for the application after the successful login an getting following error.
    Can anyone please help me on this issue.

    Server Error in '/HealthVaultHelloWorld' Application.

    Keyset does not exist

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Security.Cryptography.CryptographicException: Keyset does not exist


    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [CryptographicException: Keyset does not exist
    ]
    System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +1520238
    System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) +55
    System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() +79
    System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) +309
    System.Security.Cryptography.RSACryptoServiceProvider..ctor(CspParameters parameters) +9
    System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey() +199
    Microsoft.Health.ApplicationConfiguration.GetSignatureCertRsaProvider(Guid applicationId, RSACryptoServiceProvider& rsaProvider, String& thumbprint) +335
    Microsoft.Health.Web.Authentication.WebApplicationCredential.SetupSignatureCertRsaProvider() +117
    Microsoft.Health.Web.Authentication.WebApplicationCredential.Initialize(Guid applicationId) +258
    Microsoft.Health.Web.Authentication.WebApplicationCredential..ctor(Guid applicationId, String subCredential) +202
    Microsoft.Health.Web.WebApplicationUtilities.GetPersonInfo(String authToken) +93
    Microsoft.Health.Web.WebApplicationUtilities.HandleTokenOnUrl(HttpContext context, Boolean isLoginRequired) +147
    Microsoft.Health.Web.WebApplicationUtilities.PageOnPreLoad(HttpContext context, Boolean logOnRequired) +51
    Microsoft.Health.Web.HealthServicePage.OnPreLoad(EventArgs e) +57
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1323


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433







    Thanks & Regards,

    Sathya N

    Monday, August 11, 2008 12:29 PM

Answers

  •  

    This error usually occurs if the IIS worker process does not have permissions to open the certificate. Did you run the batch file which gives this permission?

     

    Raj

    Monday, August 11, 2008 12:58 PM
  •  

    There is a cert folder which comes with a certifcate and 2 batch files.

     

    You need to import the .pfx cert to your local machine certificate store and run the appropriate batch file.  Running the batch file gives necessary permissions for the API to access the certificate at runtime.

     

    Let me know if you need any further help.

     

    Raj

    Monday, August 11, 2008 3:36 PM

All replies

  •  

    This error usually occurs if the IIS worker process does not have permissions to open the certificate. Did you run the batch file which gives this permission?

     

    Raj

    Monday, August 11, 2008 12:58 PM
  • Hi Raj

    Can you kindly tell me which batch file i should run to the permission?

    Thanks
    Sathya N
    Monday, August 11, 2008 1:42 PM
  •  

    There is a cert folder which comes with a certifcate and 2 batch files.

     

    You need to import the .pfx cert to your local machine certificate store and run the appropriate batch file.  Running the batch file gives necessary permissions for the API to access the certificate at runtime.

     

    Let me know if you need any further help.

     

    Raj

    Monday, August 11, 2008 3:36 PM
  • Hi Raj

    Thanks a lot..
    Ur suggestion worked for me properly
    Thanks again



    Sathya N
    Tuesday, August 12, 2008 5:12 AM