Tuesday, February 9, 2016

Quick fix for a small issue while upgrading project to Visual Studio 2010

Here’s another quick fix for a small issue you may encounter when upgrading your project to Visual Studio 2010.  You may find that the import works okay, but when you go to compile, you get the following error message:
Cannot import the following key file: keyfile.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_0123456701234567
The cause of the error is exactly as Visual Studio described: it can’t open the key file it needs to access because the key file is password protected.  The suggested fix, however, is not likely to set you on the right path.  In fact, Visual Studio should really just fix this itself.  In previous versions, it would.  Remember you’d occasionally get a password prompt when opening a project for the first time?
Well, all we need to do to fix this is trigger Visual Studio to ask you for the password.  Then, it will do its thing and you’ll be set.  Try this:
1.                 Open Project Properties. 
2.                 Click on the Signing section. 



3.                 Where it says ‘Choose a strong name key file:’, reselect the current value from the drop-down box: 

 4.                 Visual Studio will now prompt you for the password.  Enter it.
 
5.                 You might get another error message:

”An attempt was made to reference a token that does not exist”

If so, just ignore it. 
6.                 Click the ‘Change Password” button:  
7.                 Enter the original password in all three boxes and click OK. If you’d like to change your password (or if your old password doesn’t meet complexity requirements), you can do so now. 
8.                 Repeat for each key file in your project. 
9.                 Save your project and do a rebuild.

Of course, there are less empirical ways of solving this, but they involve using the signtool.exe application and messing around with the certificate store.  This might not be the most impressive way of solving this problem, but it seems to work.

Thursday, November 26, 2015

Architechure Of DotNet Framwork

.NET FRAMEWORK

* Microsoft  .NET ( pronounced "dot net") is a software component that runs on the Windows Operating System.

*.Net Provides tools and libraries that enable developers to create Windows software much faster and easier.

*The .NET Framework must be installed on user's PC to run .Net applications.


.Net Architecture



Components Of .Net Architcture

Microsoft .Net Consists of four major components :

*Common Language Specification (CLS) - Green in the diagram.

                            * Framework Class Library(FCL) - Dark Orange

                            *Common Language Runtime(CLR)- Dark Yellow

                            * DotNet Tools : Cream Colour (Extreme Right)









Digital Notifications Using .NET







Notification Engines 

àNow a Days, The Digital Technology use has increased in many folds.
àThe demand for the Mobile Apps (Android, Apple IOS) integration with the core software is tremendous. The notifications from the retail customer software's, social media sites etc. are adding business advantages.
àIn order to push notifications from the .Net application following mentioned platforms can be helpful.

Few Notification Mechanisms :

1.Amazon Device Messaging (ADM)
2.Apple Push Notification Service (APNS) for both iOS and Mac OS X
3.Baidu Cloud Push (Baidu)
4.Google Cloud Messaging for Android (GCM)
5.Microsoft Push Notification Service for Windows Phone (MPNS)
6.Windows Push Notification Services (WNS)

Thursday, January 8, 2015

Difference between Build, Rebuild & Clean

Dear .Net developers , While using visual studio many times we come across this key words. Let understand us the difference between them.

  • Build solution will perform an incremental build: if it doesn't think it needs to rebuild a project, it won't. It may also use partially-built bits of the project if they haven't changed (I don't know how far it takes this)
  • Rebuild solution will clean and then build the solution from scratch, ignoring anything it's done before
  • Clean solution will remove the build artefacts from the previous build. If there are any other files in the build target directories (bin and obj) they may not be removed, but actual build artefacts are. I've seen behaviour for this vary - sometimes deleting fairly thoroughly and sometimes not - but I'll give VS the benefit of the doubt for the moment :)

         Hope you have got this.

Saturday, June 15, 2013

Web Farm and Web Garden :



Visual Studio has its own integrated ASP.NET engine which is used to run the ASP.NET Web application from Visual Studio. ASP.NET Development Server is responsible for executing all the requests and responses from the client. Now after the end of development, when you want to host the site on some server to allow other people to access, concept of web servers comes in between. A web server is responsible for providing the response for all the requests that are coming from clients. The below diagram shows the typical deployment structure of an ASP.NET Web application with a single IIS.

Clients request for resources and IIS process the request and send back to clients. If you want to know more details on How IIS Processes the request, please read one of my articles about “How IIS Process ASP.NET Request?”.


Web Farm
This is the case where you have only one web server and multiple clients requesting for resources from  the same server. But when are is huge amount of incoming traffic for your web sites, one standalone server is not sufficient to process the request. You may need to use multiple servers to host the application and divide the traffic among them. This is called “Web Farm”. So when you are hosting your single web site on multiple web servers over load balancer is called “Web Farm”. The below diagram shows the overall representation of Web Farms.


In general web farm architecture, a single application is hosted on multiple IIS Server and those are connected with the VIP (Virtual IP) with Load Balancer. Load Balancer IPs are exposed to external world to access. So whenever some request will come to server from clients, it will first hit the Load Balancer, then based on the traffic on each server, LB distributes the request to the corresponding web server. These web servers may share the same DB server or maybe they can use a replicated server in the backend. So, in a single statement, when we host a web application over multiple web servers to distribute the load among them, it is called Web Farm.

   

Now, by default, each and every Application pool contains a single worker process. Application which contains the multiple worker process is called “Web Garden”. Below is the typical diagram for a web garden application.



In the above diagram, you can see one of the applications containing the multiple worker processes, which is now a web garden.So, a Web application hosted on multiple servers and access based on the load on servers is called Web Farms and when a single application pool contains multiple Worker processes, it is called a web garden.


Web Garden
Now, let’s have a look at what is Web Garden? Both the terms sound the same, but they are totally different from each other. Before starting with Web Garden, I hope you have a fundamental idea of what an Application Pool is and what a Worker Process is. If you have already read the article, “How IIS Processes ASP.NET Request ?”, then I can expect that you now have a good idea about both of them. Just to recall, when we are talking about requesting processing within IIS, Worker Process (w3wp.exe) takes care of all of these. Worker Process runs the ASP.NET application in IIS. All the ASP.NET functionality inside IIS runs under the scope of worker process. Worker Process is responsible for handling all kinds of request, response, session data, cache data. Application Pool is the container of worker process.Application poolis used to separate sets of IIS worker processes and enables a better security, reliability, and availability for any web application.

Create Web Garden in IIS 6 and IIS 7

Now, I am going to show how you can change the Number of Worker processes in both IIS 6 and IIS 7. For IIS 6, Right Click on Application Pool > Properties > Goto Performance Tab.



In the “Performance Tab” section, you would have one option called “Web Garden” where worker process sets to “1”, you can set the number of worker processes that you required.
For IIS 7, Right Click on Application Pool > Go To Advance Settings > In Process Model section, you will have “Maximum Worker Processes”. You can change it more than 1 to make it as a web garden.





In the above image, you can also check the definition of Web Garden.

Advantages of Web Farm and Web Garden

Now, let’s have a look into the advantages of both the Web Farms and Web Gardens.

Advantages of Web Farm

  • It provides high availability. If any of the servers in the farm goes down, Load balancer can redirect the requests to other servers.
  • Provides high performance response for client requests.
  • Provides better scalability of the web application and reduces the failure of the application.
  • Session and other resources can be stored in a centralized location to access by all the servers.

Advantages of Web Garden

  • Provides better application availability by sharing requests between multiple worker process.
  • Web garden uses processor affinity where application can be swapped out based on preference and tag setting.
  • Less consumption of physical space for web garden configuration.

How to Manage Session in Web Farm Mode?

While using session, requests are distributed among different servers. By default, session mode is set to In Proc where session data is stored inside worker process memory. But, in Web farm mode, we can share the session among all the servers using a single session store location by making it Out proc (State Server or SQL Server Mode). So, if some of the servers go down and request is transferred to the other server by the Load balancer, session data should be available for that request.




In the above diagram, you can see that we can both the IIS server sharing the same session data which is stored in out of worker process. You can read one of my previous articles “Exploring Session in ASP.NET” where I have explained how you can configure session mode for Out Process mode.



While using Web garden with your application, you need make a couple of configuration settings in web.config in<process Model> section where you need to set certain properties like cpuMaskRequestLimitwebGarden,ClientConnectCheck, etc.


Summary

When we host a web application over multiple web servers to distribute the load among them, it is called Web Farm and when one application has multiple worker processes, it is called a Web garden.
In this blog post, I have explained the very basics of what a Web Farm is and what a Web Garden is. As this blog post contains the basic information to understand the fundamentals of web farms and web garden concept, I will be posting a separate article with details configuration setting for web garden and web farm. You can read the following articles for more information:





Wednesday, June 12, 2013

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154



The causes of above errors are as follows :

1.The Excel COM object is not installed or registered on the server.
      -->Is it compulsory to install the MS office in order to use Excel  interop.Excel assembly for reading Excel file.

 2.The office COM components are 32 bit only. Under the application pool's advanced settings, set the following option.
     --> Enable 32-Bit Applications to True

Saturday, June 1, 2013

How to setup multiple startup projects in Visual Studio ?


In this blog post I am going to describe a small tips of visual studio where you will get to know how you can  launch multiple project at same time. This is quite useful when you are working on a solution which having multiple project type and you want to run few of  them in same time.

Let’s assume you have a frontend application which developed using WPF and in the backend you are calling a WCF Service. Now to test the application you need both of them on running stage. By default Visual Studio project Setup type sets to Single Startup Project . If you set any of the project as “Start up” then that project will start when you run the application.  So after that you need to run the second project also. Below is the Project setup window where you can find the all the setting related with project start up. You can open that window by right clicking on Solution” > Properties > Common Properties” > Startup Project”

 

Now, if you look into the above picture you will find we have three options for project setup.
1. Current Selection : This selection will automatically select the project as startup when ever you will click on the project.
2. Single Startup Project : This is the default setup for Visual Studio where first created project will be set as startup, if you want to change the startup project, just right click on the project and select “Set as Startup Project” or Open the properties windows and select the project from the dropdown window of “Single startup project” as shown in below picture.a




 

 


3. Multiple Startup Project: For above two option you can run only one project at a time. So if you want to run multiple application same time  you can change the setting from Multiple project setup section. Using multiple startup project setting you can set the multiple startup project from the Action Tab.






So if you set both of the project action “Start” and run the application both of this project will run. So you do not need to rework to start the different project again.
I hope  this post will help you and save your time from next time.