Monday, November 25, 2013

Configuration of Class Library

I have developed a ws client in a class library and the code of the ws client is generated by adding a web references.  When I want to move the ws client from uat environment to production environment, the client does not work at all. The problem is raised since I only update the configuration of app.config  inside the class library. As the ws client is a class library, the configuration in app.config will be ignored. Afterwards, I update the  Reference.cs which is generated by vs.

.Net: This application needs to use a cryptographic key

My application is required to integrated with a HTTPS web services. A popup windows is shown when I execute the console application under debug mode. It  requests some permission for key access. After I grant the access, the application works fine.



 Then, I publish the application to IIS and windows security popup is shown when I browse the site. Actually, the site doesn't work. 


The absence of windows security popup gives me some idea on the permission on existing private key. 

There are two ways to solve above issue.
1. Give permission to this folder C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys directly
2. Go to cmd-> type "mmc"-> add snapin certificate->click folder personal->right click->All Tasks->import your private key->right click your private key->All Tasks->Manage Private Key...->grant the permission.