Thursday, February 9, 2012

Install Certificate in Local computer Certificate Store


Many times application development needs certificate to be installed in Local Machine – My store. My store actually refers to personal folder in present in certificate manager.
When you open “Run” window and type “Certmgr.msc”, the certificate store for CurrentUser opens and not for local machine. To open Local Machine certificate store follow the steps mentioned below.   
Open “Run” window and type “MMC” and click OK. This will open window named as “Console 1”. Under file menu select “Add Remove Snap in option as shown below –

Windows Azure – Adding STS reference from Access Control Service in Azure web role

Here I assume that, you have already configured Access Control Service on Azure portal. You are ready with relying party application added to your ACS on Azure ACS management portal. You have configured identity provider say ADFS or any other of your choice. Here I will be discussing steps specific to adding STS reference in your Windows Azure Web Role Application.
First of all we need to download WIF SDK and install it on the development machine which has VS 2010 installed. Once WIF SDK installed, open visual studio and right click on Web role project. You will see “Add STS Reference” option visible. Click on it to launch a new window.

Hosting multiple virtual applications in Azure Web Role

Web role can be used for hosting different virtual application. The web role supports running a virtual application within a site.
Same web site project added in solution can be used to host as a multiple virtual application within web role. Service definition file in Azure Cloud service project is used for this purpose. The <sites> element in ServiceDefinition.csdef file helps us to host multiple virtual applications within a web role application. Following is the description how you can achieve it.
Open VS2010 and create Azure Cloud Service Project. Add a simple web role in it. Once done, right click on solution and click on “Add” to add another new project in the same solution. So the final solution structure in VS2010 will be as shown below. Here I have added another web application within my cloud service solution. You can add a simple web site also instead of web application.

Monday, January 30, 2012

The backup set holds a backup of a database other than the existing database

Yesterday I received a database backup from my client and he told me to restore it to current database. I asked him how much time I have. Being from non-technical background, he said you 1 full day to do this and I was so happy. I was quite sure that, restoring database backup is of 5 minutes job using SQL Server Management Studio.
So needless to stay, whole day I was in table tennis room. It was only half an hour remaining for end of day, I came to desk and tried to restore the backup and I received following error – 
TITLE: Microsoft SQL Server Management Studio
------------------------------
Restore failed for Server 'MySQLServerName.  (Microsoft.SqlServer.SmoExtended)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'MyDBName' database. (Microsoft.SqlServer.Smo)
Error Id -3154
I was trying to restore my backup from SSMS only and I received this error every time I tried to restore.bak file.
Solution –There are two ways by which you can restore .bak file in SQL Server 2008