January 19, 2015

Why do you need to run VS in Admin Mode

Limit user account the Best Practice

For the usage of Visual Studio, user permission requirements for Visual Studio vary depending on the operating system and the Visual Studio version. A programmer should work as a limited user with admin access. That is, the programmer should be the admin of the machine, but while working, he should always use a limited user account. For installing Visual Studio ultimate version, we need admin rights, since it makes many registry entries, it need access to certain components in system. For all other editions like professional or basic installation we do not need admin rights.

Why do we need Admin rights for development using VS 2013?

Admin rights are required in the following cases • Create website under IIS requires Elevated Privileges • We need admin rights to setup the local IIS and to debug code running under the local IIS. However the basic web server built In Visual Studio does not need admin rights. • First is if you're doing something like developing Windows services or shell extensions (rather than, say, desktop or Web applications). Then you'll need to have the ability to install, remove, start, and stop services; install shell extensions; Re-launch Explorer, etc

Elevated Privileges

For elevated Privileges add yourself as Power-User / Debug-User for debugging. In order to add you to power user follow this steps. My computer -> Manage-> local User and Groups -> Power Users Similarly you can add yourself to debug users as well. When we need to do operations such as changing time zones. For legacy applications that require the same Power User rights and permissions that were present in previous versions of Windows, administrators can apply a security template that enables the Power Users group to assume the same rights and permissions that were present in previous versions of Windows. Debugger Users group enables you to remotely access debugging components on other machines. Debug programs Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment Description Determines which users can attach a debugger to any process. This privilege provides powerful access to sensitive and critical OS components. This user right is defined in the Default Domain Controller Group Policy object (GPO) and in the local policy of workstations and servers. By default, only administrators and LocalSystem accounts have the privileges to debug programs.]] User Permissions in VS 2013. If the developer needs the following things to be done we need admin rights • Debugging ASP.NET Websites • Profiling • Using the emulator to debug cloud service projects for Microsoft Azure. • Debugging for XAML Browser Apps . the following link has more details on it . You only need administrative access on the remote machine in order to install the remote debugging components. You don't need it on the local machine to do the actual debugging.

March 02, 2014

How to Install IIS in Windows 8..1

 
Its best practice to install webserver and then install visual studio for web app development . This will automatically configure the required files while installing Visual Studio 2013
Go to Run command type appwiz.cpl



Click on Turn Windows Features on or OFF

The Following windows features screen appears

Click Internet Information Services Check Box
 
 
 
Press Ok. Windows Features will apply changes ,
When you select internet information services, the IIS and its required features are installed by default  , These features will help you to run and host website . However if you further require the framework extensibility, WWW services or security you can check the features that you require.  You can edit these settings whenever you need provided you are an admin to the system. You need to do a reset IIS (iisreset) to get this effected after the edit.
Now you can go ahead and install visual studio 2013
Hope this helps  .
 

April 19, 2011

Sql Azure – Error XML HTTP Request does not exist . Parameter Name: typeName

I am trying to connect to SqlAzure database from my windows azure account, when I try to authorize by giving valid database credentials I get the error as XMLHTTP Request does not exist. 

I know that Azure is stateless. But the  connections are maintained with state.Especially when we are trying to use asynchronous  calls using the XMLHTTP request object it doesn't recognize .Hence we should not use  XMLHttpRequest while working with Azure. But in this case I am not using any ajax calls or xmlhttprequests.

azure-error

I thought might be internally azure is using xmlhttprequest. I  also checked the IP addresses of my SQL Azure firewall  to allow proxy IP.  It is  not dynamic,  it’s not changed. If this is the case error will be different message. I also have all latest XML components installed in the box.

Can you guess what is the cause and problem?

The problem is its not getting connected in IE7 or FF3.6.

This  silverlight application interface uses XMLHTTP requests from the client side,  all the operations are made through a service on Azure using port 80, not directly to the SQL Azure server.since the Silverlight application uses local XMLHTTP requests components on your machine, we need to make sure that client machine using azure account has the latest XML components. Upgrading my browser to IE8 solved the issue, I think this updated latest updates and necessary components for XMLHttpRequest for Silverlight4. At least we need to have IE8/ IE9 to work.  The cause is Silverlight 4.0 some problems with XMLHttpRequest in Firefox 3.6.

Sql Azure Tips

We should have sqlserver2008R2 to work with SqlAzure

SQL Azure is only compatible with SQL Server 2008 and SQL Server 2008 R2. If we are planning to migrate database to SQL Azure we should first upgrade it to run on SQL Server 2008 or SQL Server 2008 R2.   We can take help of  SQL Server 2008 Upgrade Advisor for compatibility  test before  migrating to SQL Azure.

The SQL Azure Migration Wizard is a very good tool for testing the compatibility between SQL Server 2008 and SQL Azure. This tooll can analyze SQL Profiler traces to check the compatibility of the T-SQL statements generated by the application.

April 13, 2011

ASP.NET WebSite Vs WebApplication

 

The 'web site' model was introduced with ASP.NET 2.0, the 'web application' model was the project type of the original .net framework. Web Application project we need to do explicit build.

Web Site lets you treat it like a PHP or classic ASP site, where you can make inline changes that take effect immediately.

Pros

  • You can make tweaks to the site right on the web server
  • Deploying is as simple as copying the folder

Cons

  • If you are not making the changes right on the live site, you can get into change management problems, where you forget to keep all your files in sync
  • You can get runtime syntax errors displayed to your end users, since the only way to check is to manually run every page

For me the personal preference is Web-Application rather than  Web Site as we can get  lot of trouble when we making arbitrary changes to code-behind file in notepad while the website is running.

If it is an ASP.NET Web Application project, then you need to do a build before you post the dll to production and unless we build the files cannot get updated. This is more secured and preferred ,been used for years. As we do not want to put source code in the production server.

Website model by default source code files sit in production and what ever you change that gets automatically gets compiled and updated when you save. In Website model we need to move Code Files and also ASPX Files into the production.

Windows Azure Camp -Hyderabad - Highlights

 

Though MUGH core was so busy, we made Azure Camp at MS IDC grand success targeting cloud Developers and the professionals planning to move their applications to cloud. The event was happened on Sunday on April 10th at MS IDC. This Camp really helped for the professionals who are not aware of Windows Azure and wanted to develop their applications to the cloud. We have got 35 people as attendees , 41 including speakers.  I feel that its good turn out being hot summer, sunday , IPL match is going on , for a topic like Azure, even we published it just 3 days before the event.

Event was started on time with Shravan‘s session on “Beginning with Windows Azure”. This session mainly focused on what is Windows Azure, Why Windows Azure, What are the various roles, what are the components in it? Why you wanted to migrate to the Windows Azure?

  attnd tables

AppFabric : Helps to connect on-premises applications with Azure cloud services and resources, eases interoperability between users belonging to different domains.

SqlAzure : Is the only relational database that is hosted on the Cloud by Microsoft.

WindowsAzure: Microsoft Cloud Operating system to host your applications on the Cloud.

  AudienceJPG DSC04271

After this Azure Development Factory session was done by Arun Koshi from Microsoft Global Delivery team. The session explained about Virtualization, Auto-Scaling, Web Role, Worker Role, Creating Applications in VS2010 and hosting them on the cloud.

After this Jaberson done a DEMO in Azure SDK 1.3 and the new Azure Management Portal and Azure Architecture.

Namit-presenting  Manish

After the lunch we had highly technical session on “Cloud Storage - Windows Azure storage services” by Namit and Rahul Rai. This session clearly explained how azure tables are stored in database and how to use them effectively. This is Very productive and highly technical session.

As Audience got so much stuff in to the memory, to make them live and interactive for the next session, I have asked the questions based on the session topics. They got Windows 7 Ultimate, Office 2010 Professional Plus, and MSDN Licenses, Azure Goodies and T-Shirts as they answer the question. I am sure they enjoyed the quiz time and also their goodies.

Hima-Presenting   ORG

Finally we had last session by Manish Sharma from Microsoft. Session is on “Connecting Windows Azure to your Enterprise Network & Applications” the same session was presented in Tech-Ed 2011 Bangalore recently. This is very good opportunity for the people who might have missed Tech-Ed or missed this session at tech-ed .

We also announced about the Windows azure Contest that is going to close by 30th April . If any one of you are interested in participating in the contest details are here.

I would like to thank Mr. Abhishek Community Manager, MS for giving me the responsibility of hosting the event in Hyderabad, Harish Ranganathan for helping me all the way off line in making the event possible, all the speakers for their wonderful sessions and finally the people who attended the event on Sunday.

Hima-contest  DSC04369

Finally the event was gone well. We closed the event by 6:00PM. Here is the feedback

Hi Hima,

    I attended Windows Azure Camp yesterday. The session was very productive. I got a chance to know the thing very clearly. The speakers are very clear. Really thanks for organizing such a nice and productive event. Thanks for the Session.

----- Sudheer Kokirala , Techvedika

  I attended the session on Windows Azure camp. It was very helpful for me in learning the new technology. Thanks for the session. I am planning for a session on Azure at my workplace. so please can you share the slides that are used for the presentations and the contact details of the guys who gave the sessions.

------Naveen Kumar

You can get the presentations from this link

Please download the material from the following link. The link would expire in10 days starting from today (11:06 A.M @ April 12, 2011)

Presentation Deck: https://msgdcloudstorage.blob.core.windows.net/azureboocamp/Windows%20Azure%20Storage.pptx?se=2011-04-21T06%3A31%3A39Z&sr=b&si=readonly&sig=J6XHKFDGcJPxhCLu7LfPrwggICxNsZz92rQt7ZyVqFM%3D

And the event pictures from

https://picasaweb.google.com/shravan.systech/WindowsAzureDay?feat=email#

March 28, 2011

Day3 at Teched-India 2011

 

Interested to know about Day2 at #Techedin

Day 3’s Key note by Jason Zandor - Corporate VP Microsoft was simply superb, showed the demos of MVC3 code. Lots of new stuff is planned and coming for us to learn and update. After the key note from Jason, we have keynote from Murthy Uppaluri, Director DPE. His entrance to the key note is so exciting, he entered dressed like an Indian Batsman, and hence audience are too much excited about that, as India won the match against Australia and qualified for semifinals in the world cup.

189019_10150433980485504_500895503_17730848_3590348_n

Soon after the Murthy’s key note we had round table by Rajeev, followed by lunch. After that we have round table with Jason Zandor VP Microsoft , It was the best round table that I can say, Where we gave feedback on VS2010 , C#. Came to know about some of the things that are coming, but I am not supposed to blog or tweet or share as all of them are under MVP NDA.

190680_199417630091486_194254377274478_610564_925774_n

After this round table for a long time, I have spoken on the MVP awareness and IE9, Cloud Computing for the 24 hours Cloud day from GITCA. Hope Baxi and Ashwin share these two videos soon with me. After the technical sessions got over, there is an un conference that is stump the speaker, where people from audience asking the question for a speaker, they should be able to answer the question in 30 seconds from the time it has been asked. It was fun where we are trying to stump the speaker and speaker answers the question in 30 seconds.

200112_10150166382412594_702827593_8289593_3177014_n

Hima Vejella with Jason Zandor, Corporate VP, Microsoft at TechedIndia 2011

Now the most exciting part of Teched is to meet Anil Kumble, As all of us are cricket fans, the Kalinga Hall was completely full with audience to meet Kumble and watch his speech. Anil Kumble related technology to team dynamics. Team Building skills and the necessary to handle pressure in cricket or team. When India team does not perform well in a single match then, the team has to face lot of critics and comments. The same applies to our work; if you do not perform well on a single day whatever is performed in the past will not be visible. Hope we get the World Cup!!!

Failure is taking the path that everyone else does; success is making your own path.

189922_1787602124540_1074163652_1995272_6494134_n

Networked, Geeked, Enjoyed Round tables with Big Heads, Learnt Technology, Met most of the MVPs and Community Leads Jacob, Pinal, Amit, Anoop, Lohit, Chaithra, Chakravarthy, Vijay, Niraj, Abhijith, Abhishek, Dhanunjay, Sravan, Pranav, Joy, Harish, Ravikanth, Krishna, Soupratim, Sumit, Sanjay ,Renuka, Rahul, Ashwin .…

188810_199188610104264_100000393788500_586064_6907675_n

The enthralling ,super exciting event was closed to an end by Stuthi Shukla, Director of Marketing , India MS . These are the teched statistics.

4 live streaming partners
321 Live event screening centers accross India
3147 onsite attendees each day
1,41,750  Live online attendees

189946_10150166382627594_702827593_8289596_7265569_n 

Hima with AmazedSaint (When he look at him self he feels amazed, this is what he describes how amazed saint coined) 

I would like to thank Aaron for the pluralsight dinner party on the last day, where I got the opportunity to meet Matt Milner , Fritz Onion , Chris Eargle  (codefugu from Telerik ) and talked about technology stuff.

I am sure someone who is reading this and missed the event is definitely jealous of not attending. I cannot help you in that. Try attending the one next year 2012.

March 25, 2011

Day2 at Teched India 2011

 

Day1 at #techedin 2011

Day2 at Teched India #techedin is all about Azure, IE9, Networking and also some fun. As I missed the key note at teched-day1 due to my flight delay, I was punctual and on time, for the key note on Day2. Day 2 keynote was by Brian Hall General Manager, DPE, Microsoft India. Shown Cool demos of IE9 compared to other browsers.

The following  are the points mentioned in Key note.
• It is fast, clean, trusted, more secured, and interoperable & supports HTML5, CSS3.
• IE9 has the new JavaScript Engine Chakra, New DOM, Which is built based on Hardware acceleration. This makes your applications for less CPU Utilization and hence faster. Fast is always Beautiful.
• Layout is optimized based on feedback; Back button is larger, user friendly, less number of pixels at the top and more space to work.
• Side by Side Drag & Pull
• We can pin to task bar
• Jump lists are integrated to IE9.


We have also seen the demos from snapdeal.com, as it is developed in html5, CSS3 and jQuery gives user friendly experience.

“People do not have time to wait. As the technology is updating, people are looking for instant actions. An example for such site is www.photovault.in by Dinesh Kumble. It has the ability to take pictures at the time it is taken the people will upload to the site immediately. “  Demos on this in IE9, jQuery, CSS3 and HTML5 are shown.  Audience couldn’t control to clap the hands for the amazing UI, stunning look and feel, faster performance in IE9.

IE9 statistics are 2.3 Million Downloads in 24 hours after the Beta release, and out of this 85% are new users. We can develop amazing applications with Rich graphics using IE9, We can feel that right from the beginning to have that.
Executive Round Table with Rajeev

The basic question that comes is Why Microsoft do not support XP? Why not XP? Is it a strategy to make people to forcibly migrate to XP?
The simple answer to this question is – If you want fastest browser in the world you should have the engine that supports it. Windows XP is 10 years old OS, and the old engine do not support hardware acceleration as Windows 7 does. So ultimately if IE9 runs in XP all our applications will be very slow which we never like it. That is the reason they do not want to support IE in XP.
But still the community feels that there should be some support for the developers in IE9, to write our own plug-ins and customization integrating to face-book.
I was really touched when Brain Hall answered to someone’s question, do you think that India will win today. His instant answer was “I am pretty much Sure that they will”. And it just happened…
Soon after the IE9 key note we had key note from Bharat Shyam , GM Windows Azure , MS.

Why windows Azure?
1. Cost, Avoid Capital Expenses
2. Pay per what you use.
3. Develop highly scalable, reliable applications rapidly
4. Manageability

One of the things I really liked in this tech-Ed is MVP Round tables with product team and Big Heads of MS, where we can directly talk to them and ask for what we really require, give feedback, get solution for complex real world issues. I feel proud to me invited for that. Thanks  a lot to Abhishek(s) for making this possible.

We had productive round table with Brian Hall and Bharat Shyam, Some of them are under NDA, so we are not supposed to share blog or tweet until they get announced to public. But I am pretty much sure that Windows Azure soon going to become a big hit for MS. Also attened a chalk talk on women in Technology exclusively for Lady Professionals who are leaders in the technology. It was a Very productive discussion on how to handle team especially the persons with male egos.
After that I attended Windows Azure Sessions after the round tables. It was World Cup Quarter Finals, India Plays against Australia. Who want to miss that match, we were all the time clicking the laptops for the score. People left soon after the sessions due to the mini- final match.
Hima Vejella with Sanjay Shetty, Microsoft Regional Director.
Day 2 ends by the party from INETA, GITCA and PASS. We were given some cool T-Shirts from INETA for the UG Leads. Thanks to Sanjay for that. We just watched match in the big screen in the Hotel during Dinner. What a match!!!
Allz..Well. That’s all about my Day2. Those who didn’t attend seem that you missed the event. Is it not?
Day 3 - Cricket in Tech-Ed? Surprising!!? Inspiring speech by Anil Kumble.
 


March 23, 2011

Day1 at Tech-ED India 2011

 

I didn’t think that I will attend Tech-Ed this year as I have a very busy schedule. All of my plans were attending Global Summit this year. But some how, the Global Summit one canceled and got some time to attend Tech-Ed. My flight started from Hyderabad at 8:30 AM on 23rd March 2011, As usual I started late at home, but caught the flight on time. Reached Hotel Lalit Ashok at 10:30 AM while the key note is going on, Got registered , this time there is no problem in registration as we have separate counter for Speakers and MVPs. The first session was an un-conference . There we networked with several fellow MVPs and some of my close friends. After that I attended the session on ASP.NET MVC3. Lots of stuff to learn in MVC3 compared to MVC2. I am going to blog about that as a separate blog post soon.

conforence

Himateched-2011

MVPs at the un conference. Will post you more pictures once I upload all of them.

Today I am pleased to meet PluralSight CEO Aaron Skonnard. I am supposed to meet Aaron in Hyderabad and that didn’t happened as I was not in the city at that time.  Pluralsight Trainings are excellent, Knowledge sharing and once you start learning using those trainings, you will automatically get addicted. Its worth subscribing to their trainings.

We have a privilege to meet distinguished engineer Yousef Khalidi RD Mgmt , WindowsAzure from 4:00 PM to 5:30 PM. This is a direct roundtable with the person who is technically very very strong. We are very much pleased the way Yousef  answer all of our questions and provided solutions to the problems. Its a very productive and one of the best roundtables that I can say.

yusuf Khaldi

MVPs with Yousef Khalidi Distinguished Engineer, Windows Azure

My Question to Yousef Khaladi was, What is azure side enhancements in Interoperability side , Integration with Java or any other language.  The answer was Initially they were concentrating on one technology ,now they are stabilized so soon we can expect toolkit to play with Java and Azure using the API.

One of the feature request that came in the conference was having client side API using Azure, Azure with Siliverlight integration would definitely benefit the developers.

I had the opportunity to meet VSTS 2010 product team from Microsoft IDC. Had Demos and Lot of Q&A with them. If you get some time try to meet the Azure team or VSTS team they have pretty cool stuff to show case.

Then we had Community Talk and plan for the Web Developers day, Windows Azure Day for MUGH in the evening that ends my Day1 at teched. I will be blogging more on tomorrow as I am feeling a bit tired and going to sleep. So stay Tuned.

I still have the last year memories for Tech-Ed meeting Soma and having lunch with him. You can still read the above link to know what happened in Teched 2010

March 21, 2011

ASP.NET Performance Tip4 - while using ajax updatepanel

If you have multiple update panels in web page, make sure that you put updatemode for update panel to ”Conditional” to prevent loading of other update panels in any asynchronous post back.

By default update panel will have the updatemode property to always means if any asynchronous pushback is done  for any of the update panel it loads all the update panels in the page.  This is against to partial post back rendering.

So it is always a best practice to set updatemode  property to conditional to optimize update panel performance wise and to load best results.

To observe this observe Trace  the Requests and Responses using httpwatchpreofessional 5.2

March 14, 2011

ASP.NET Performance Tip3 - Use using key word

The using keyword is basically a try - finally block, without a catch , where IDisposable.Dispose() is called in the finally .

Using block defines a scope, outside of which an object or objects will be disposed.

Use using keyword for the objects that  hold any resources other than managed memory.  For Example like files, sockets, database connections, or even GDI drawing handles.

We should  be using "using" whenever the class implements IDisposable. So use of using keyword will always help to avoid Garbage Collection call or explicitly calling garbage collector to

destroy objects.

For example

using(Dataset ds = new Dataset())
{
//code
}

We do not need to worry about destroying objects once the job is done. Garbage Collector will take care of it.


using(ClassName x = new ClassName())
{

     ...use x here...

}

This will automatically remove the resources occupied by the obejct x.

Another Example while working with database objects :

 

using ( SqlConnection connection = new SqlConnection(connectionString) )


{

      SqlCommand cmd = new SqlCommand(commandString, connection);


      connection.Open();


      using (SqlDataReader reader = cmd.ExecuteReader())


      {


         while (reader.Read())


         {

    listBox1.Items.Add(reader[0].ToString() + ", " + reader[1].ToString());
}
}
}
But normally we use try ,catch and dispose objects explicitly in Finally. Why to do this when we have the job that will be done by CLR through GC with the help of using keyword. A "using" statement can be exited either when the end of the "using" statement is reached or if an exception is thrown and control leaves the statement block before the end of the statement. Multiple Objects can be used with using statement as
using (Furniture chair = new Furniture(300, 400),
table = new Furniture(20, 100))
{
    // Use chair and table.
}

It is very important to know when to use what and implement best practices to achieve for performance , reliability

March 06, 2011

ASP.NET Performance Tip2

Read Tip1 Here

2.  Disable Session State

In ASP.NET Session State  is on by default for every page . So we need to disable Session State if we are not going to use it.  Sessions are created to  pass information from one page to other page per user. We do not require Session State when web pages are static or when there is no need to store information captured in the page.  Do not use sessions to store Global data that is specific to all users. Session is specific to single user.

We can this off for specific pages, as well as entire page depending on the requirement. Usage of sessions will significantly decrease the performance of the application .  So we need to try to minimize the use of  sessions in Web Applications.  If we are not using Sessions in the application it can be set off in the web.config that applies to entire application.

Otherwise it can be disabled in page level as

<%@ Page language="c#" Codebehind="Form.aspx.cs" AutoEventWireup="false" Inherits="WebApplication1.Form" EnableSessionState="false" %>


In web.config  we can turn off sessionstatemode under System.Web Section as follows.

<sessionState mode="off"></sessionState>

As all of us know,ASP.NET Manages session state automatically. But if we do not require Sessions, disabling it will help in boosting the performance of the application.

March 05, 2011

ASP.NET Performance Optimization Tips

I would like to write series of tips for my blog readers on ASP.NET Application performance and what kind of tips we need to follow to improve it .We design and develop web applications. Perfect. Works Fine in Development Server. We will not have huge data as we have in production environment in the development environment.

So everything goes well in development , QA Testing , Staging. But when it moves to production common problem is Performance . Each & Every Web Developer struggle to make their applications scalable.  When multiple users accessing the application simultaneously, or if we have larger data from years that has grown in the database what are the precautions we need to take?  General Question that sucks is What are the best practices to improve the performance of the application.? So Read on.. and stay tuned for daily updates

1. Disable View State if not used

2. Disable Session State if not required

3. Use using keyword to define scope for objects dispose

4. Set Updatepanel  updatemode to conditional

March 04, 2011

ASP.NET Performance Tip1

1. Disable View State

The view state is important for an ASP.NET page because it is mainly used to persist the state of the Web server controls. As ViewState has performance and security Hit it is important to use to properly and how to ?

ViewState is passed to the client during every postback as an hidden element.  Viewstate is stored in an encrypted format. You can view the view state in Page Source . As its added for every page  view state will definitely effect loading of page at the client side.

Disable ViewState when it is not required.or used.  

For ex: For a Grid that is just used to display records that acts as HTML table , not firing any GridView events or Sorting or paging it is best practice to always disable ViewState.

To add more to optimize webpage performance we need to disable ViewState in the following cases.

  • When a page do not postback to itself
  • When there are no dynamically set control properties
  • When the dynamic properties are set for each request of the page

ASP.NET4 comes with very interesting property called ViewStateMode.  ViewStateMode property is used to control the Viewstate at Control level or Page Level or application level in config File.

Why is this Property ? What is the significance of this?

You can Disable viewstate at page level and enable viewstate at control level using this viewstatemode property. This viewstatemode comes with 3 properties namely

1. Enabled

2. Disabled

3. Inherited  -  ViewStateMode gets inherits from parents control viewstatemode property. For ex. If we have a label inside a panel and label’s viewstatemode property set to inherit, then its viewstatemode property gets inherited from panel. As panel is parent control for label.

If we disable Viewstate at page level and enable viewstate at control level then there is no use as the page level settings override the control settings.

So with the help of this new property we can set viewstatemode to false at page level  and enable viewstatemode for individual controls at control level so that unnecessary viewstate can be avoided.

Note: Viewstatemode property can be used when viewstate is enabled which is set at page level by default.

February 28, 2011

Difference between encryption and encoding

 

Both are not same. But seems to be synonymous.

1. Encoding is to convert data by the use of a code.
2. Encrypting is to format (electronic data) according to a standard format

Encryption is secret . This can be achieved by converting string to cipher text using cryptographic algorithm and key. Encryption and decryption happens using this unique key. The cryptographic encryptioalgorithm and key are responsible for the encryption quality. Encryption involves encoding internally. encoding of the data takes place both before and after encryption.

To use encryption in .NET we need to import the name space  System.Security.Cryptography

Encoding is the way the data get formatted. Generally used in cryptography to mean that secrecy is not involved. If we know the format that is used to encode the data,the encoded data can be decoded by anonymous. So please do not use encoding to store passwords in database instead use encryption.

http://himabinduvejella.blogspot.com/2011/02/what-is-machine-key-in-webconfig.html

February 27, 2011

What is Machine Key in Web.Config

The <machineKey> attribute is used in web.config settings when encrypting and decrypting the data for the webapplication in ASP.NET. It is used to set Encryption algorithm for validation in general. Machine Key attribute can be used to set

1. Encryption of View State

2. Encryption for Forms authentication cookie data

In order to make view state tamper proof we use EnableViewStateMac = true .  This can be applied at page level too. MAC stands for Message Authentication Code. By setting this property to true Viewstate is encrypted in a cipher format .

If we encrypt Viewstate we must speicify validation and encryption method in machine key attribute of the web.config  as below.

Example

<system.web>
<pages buffer ="true" enableViewStateMac ="true" />
<machineKey validationKey="autogenerate | value" decryptionKey="autogenerate | value"
validation ="SHA1 | MD5 | 3DES" />
<httpRuntime maxRequestLength ="2048" />
</system.web>

So the application takes encryption validation method that is specified and validation key settings for the decryption.

For forms authentication ticket encryption, the <machineKey>  can be set as shown below.

<machineKey
  validationKey="AutoGenerate,IsolateApps"
  decryptionKey="AutoGenerate,IsolateApps"
  validation="AES"
  decryption="Auto" />

Why do we need to encrypt and decrypt the viewstate?

View State is not secured. It is good design practice to encrypt the View State and store due to security reasons. By default ASP.NET uses SHA1 algorithm to encrypt View State.When working with sensitive data, it is best practice to utilize encryption.

How to do it at Page Level or control Level?

ViewStateEncryptionMode is the attribute that is used for encrypting viewstate. It can be applied at page level or web.config level for the application. Below is the code how we use viewstateencryption mode attribute

<configuration>

<system.web>

<pages  ViewStateEncryptionMode="Always" />

</system.web> </configuration>

ViewStateEncryptionMode attribute has 3 properties as

  • Auto (deafult),
  • None( No Encryption for the control’s View State)
  • Always

If the mode is “Always” ASP.NET does not wait for a control in the page to request encryption. View State is always encrypted.

If the mode is “Auto” ASP.NET will encrypt the View State for a page if any control on the page requests it only. This is the default value.

If the mode is “None”, encryption is never done for View State  even though it is applied and controls on the page requested it.

What is Singleton Design Pattern? How did you implement it?

Singleton Design Pattern class and maintains that single instance throughout the lifetime of the program. It can easily access that single object instance without creating multiple instances. The single instance provides a global point of access to it.

You need to create a private constructor to implement it

class Singleton
{
//declare only once
private static Singleton Instance = new Singleton();
public static Singleton Ins()
{
//reuse declared instance
return Instance;
}

private Singleton()
{
//No public access allowed
//Private constructor
}
}

static means shared that help to create only one instance.

There are 2 tips in singleton design pattern implementation

1. Create private constructor

2.  Create static methods  to reuse single instance of the static object.

There are situations in real world where we need only to create  one instance of the object and shared  across the clients.

Where exactly it can be used in real time ?

Singleton design patter can be used in Banking, Financial or Travel based applications where the singleton object consists of the network related information.

if our application is an online store that allows each seller to have a customized store, if implementation of the store is a singleton object,  then the singleton instance will be created for each user . This  will  avoid a seller creating multiple stores,

An ASP.NET Web Farm (multiple server deployment) is also based on the Singleton pattern. In a Web Farm, the web application uses on several web servers. The session state ( OUTPROC) is handled by a Singleton object  in the form of exe file. This exe file interacts with the ASP.NET worker process(aspnet_wp.exe)  running on each web server. Even if one of the web servers shutting down, the singleton object still maintains the session state information across all web servers in the web farm.
Singleton pattern as a LoadBalancing object.  We  can have single instance per application, per user, per role or other criteria.

February 25, 2011

Dotnet Quiz - 2011 - Free online Technical Event

Participate in DotnetQuiz to Win an Apple IPAD .
I am organizing general dotnet quiz at Beyondrelational.com for the dotnettechnology.
This quiz contains questions related to VB.NET, C#, Entity Framework, ADO.NET, MVC, Design patterns, MVVM, Silverlight, WPF, WCF.

Test your DotNet knowledge from 31 reputed MVPS and Community Leaders who are passionate for the technology from all over the world win, Cool goodies as prizes. I am organizing online DotnetQuiz that includes MVPS from various streams and community leaders that tests your knowledge on different technologies. You can discuss, explain and understand the Concepts or misconceptions in the community in depth while trying to answer a question.

Dotnet Quiz consists of 31 questions, managed by 31 quiz masters who are experts in Dotnet. Each quiz master will ask one question and will moderate the discussions , answers will identify the winner of each quiz. Each answer that is correct will get a certain score (between 1 and 10, where 10 is the best) the scores of all the 31 questions will be added up to identify the final winner."
I have some of my favorite people as Quiz masters. This is the great chance to share and spread the knowledge in the community. Interested professionals in the particular area can participate in the quiz. Details are here.

Grab the questions and answer them before they get closed.

February 15, 2011

WCF Data Services Toolkit released

The intent of the toolkit is to make it easier to expose arbitrary data sources as OData services. Examples of such data sources might be:
An existing web API XML/CSV file(s)
Data stored within a proprietary software system
The toolkit also makes it easy to mash-up multiple data sources so that creating a "unified model" is possible, regardless how much disparate data you or your customers might have.

This project was created from the needs of our live partner services (e.g. eBay, Netflix, Facebook, Twitpic) and will continue to be iterated on as we discover new scenarios and needs during future partner engagements.
Read the following blog post to get an introduction on how to use the toolkit: Looking forward to seeing what the community does with the toolkit and are of course very open to feedback/suggestions/comments

February 11, 2011

Updates to the Microsoft Certified Master for SQL Server 2008 Program

Used to recognize and certify the top SQL Server talent in the world, Microsoft’s most advanced SQL Server certification is now more accessible than ever
Microsoft has made significant changes to the Microsoft Certified Master (MCM) program for SQL Server 2008, and these changes present a great opportunity for Partners to equip their technical staff with top tier SQL Server certification.


The SQL MCM program formerly required three weeks of training at Microsoft – a fact that put the certification out of the reach of many SQL Server experts worldwide, because of the time, travel and expense involved in achieving the certification. By eliminating the mandatory training requirement, plus consolidating the required exams into one knowledge exam (available now) and one lab exam (available soon) Microsoft can provide highly experienced SQL Server IT professionals worldwide with validation of their deep technical expertise, no matter their learning style and economic means.  With online exam prep materials, and exams available through select Prometric Testing centers worldwide, MCM for SQL Server 2008 is now within reach of more SQL Server professionals globally, while maintaining the integrity and value of this advanced certification.


Now more than ever, it’s a great time for Partners to sponsor their qualified SQL Server professionals to pursue MCM for SQL Server 2008.  Having MCMs on your staff sets you apart from your competition, and tells your customers that you can meet their most complex business requirements.  In fact, evidence has shown that customers have engaged with Partners based primarily on the fact that they have MCMs on their team. An investment in your employees is an investment in your company’s future, and can make for higher quality SQL Server deployments in mission critical environments. Find out more, and start making this investment today.

Resources:

      SQL Server MCM Program (program rules and details)  
      How do you know if you’re ready for SQL MCM? (Blog post)
      SQL MCM 2008 Readiness Videos  (for the full list of videos – click the “More” link at the bottom of the page)
      SQL MCM Question forum (Questions about the program from other SQL professionals)   
      Prometric Exam Locations for SQL MCM (Current approved Knowledge Exam centers, and location of information once the Lab Exam is available)

February 02, 2011

Windows Azure Platform Training Kit Update

MS has released January 2010 update to the Windows Azure Platform Training Kit & Training Course.The Windows Azure Platform Training Kit & Course includes a comprehensive set of technical content including hands-on labs, presentations, and demos that are designed to help you learn how to use the Windows Azure platform, including: Windows Azure, SQL Azure and the Windows Azure AppFabric.
Download the Windows Azure Platform Training Kit.
Visit the Windows Azure Platform Training Course on MSDN.
The January update provides new and updated demo scripts and a new Windows Phone 7 hands-on labs for the Windows Azure Platform. These new demo scripts demonstrate how to use Windows Azure Connect, Web and Worker Role Enhancements, Windows Azure Virtual Machine Roles, and the "Rafiki" application (a keynote demo at PDC10). Additionally, this kit includes an improved mechanism for installing Visual Studio code snippets.
Some of the specific changes with the January update of the training kit includes:
  • [New demo script] Windows Azure Connect

  • [New demo script] Web and Worker Role Enhancements

  • [New demo script] Windows Azure Virtual Machine Roles

  • [New demo script] “Rafiki” Application

  • [[New lab] Windows Phone 7 and The Cloud

  • [[New lab] Use Access Control Service to Federate with Multiple Business Identity Providers

  • [[Updated] All Identity HOLs have been refreshed

  • [[Improved] Visual Studio code snippets installation

  • [[Fixes] Several bug fixes in demos and labs


Release: January 2011 Update
Version: 2.3