Showing posts with label util. Show all posts
Showing posts with label util. Show all posts

Sunday, November 28, 2010

EnableViewState on ASP.NET Text box

While I was helping one of my friend this weekend in getting up to speed in ASP.NET basics, I was trying to demo View state by example and added couple of text boxes and a button control to showcase the stateless behavior of web and how view state helps(brings performance problems most of the times) developers to retain the values between post back.

But the sample app retains value between post back even after disabling the view state in control level and as well as in Page level. Puzzled a bit and tried to reproduce the same scenario with other controls such as check box and a calendar control. To make it worse for Calendar control the view state works as expected and for check box control, it maintains the state even though the view state is disabled.

After couple of minutes searched in Microsoft Knowledge base found this knowledge base article KB316813 which solves the puzzle stating that the following set of controls will persist value across requests even though the view state is disabled.


  • The TextBox control.
  • The CheckBox control.
  • The RadioButton control.

The values which are posted to the server are handled by the IPostBackDataHandler interface.

Wednesday, September 1, 2010

Unlocker : Error debug privileges

If the user doesn't have permission for remote debugging,Unlocker  will fail with the following error message

Error Debug privileges

Provide Debug privileges for the user in the target machine to satisfy Unlocker

Start -> Run -> "secpol.msc" then click ok
Expand "Local Policies" in left pane
click the "User Rights Assignments" folder
On the right hand screen double click "Debug Programs"
Click the "Add User or Group" button
Click the "Advanced" button
Click the "find now" button
select your "user logon name" and then click the "Ok" button



Changes will take effect after a logoff or a reboot. 

Tuesday, July 20, 2010

Load testing SharePoint pages using JMeter

Recently I found myself in search of an open source web load testing tool to do testing and to measure my SharePoint application's home page performance. Apache Jmeter a feature rich tool to prepare a load test which helped to arrive at the statistics.
JMeter Java desktop application which comes in an executable jar file and can be downloaded from here. Obviously you need java runtime(JRE) to start this jar file.
open the bin folder and open ApacheJMeter.jar file from windows explorer
Right click the Test Plan and add a Thread group

Provide the applicable values


Thread group configuration
  • Name - Give a name to store all settings in a jmx file.
  • Number of Threads - Number of concurrent users to hit the page
  • Ramp-Up Period - Thread acceleration period If the number of threads used is 10 and the ramp-up period is 20 seconds,it will take 20 seconds to create those 10 threads.i.e,one new thread in every two seconds, want to create all threads in a single shot, put zero in this
  • Forever - this option tells to keep sending requests to the tested application indefinitely. If disabled, JMeter will repeat the test for the number of times entered in the Loop Count box.
  • Loop Count - the number of times it has to repeat the test, it is effective only if the Forever check box is unchecked
  • Scheduler - want to specify the start and end time of the test, you have an option here
Once the Thread Group is configured add a Sampler called "HTTP request"



Provide the server name, port number, method etc


HTTP Request configuration
  • Server Name or IP - the server name or the IP address of the machine running the application being tested.
  • Port Number - the port number used by the web application
  • Protocol - the protocol used, either HTTP or HTTPS.
  • Method - the request method, either GET/POST/PUT or other options.
  • Path - the relative path to the page you want to hit
  • Follow Redirects - follows redirections sent by the Web application, if any.
  • Use KeepAlive - if checked, sends the Connection = Keep-Alive request header. By default, an HTTP 1.1 browser uses Keep-Alive as the value of the Connection header. Therefore, this checkbox should be checked.
  • Parameters - the list of parameters sent with this request. Use the Add and Delete buttons to add and remove parameters.
  • Send a file with a request - simulate a file upload to the Web application, good to test a large file upload through POST request scenario
  • Retrieve all images and Java Applets - download embedded content.
Add a couple of listeners "View results as Table" & Spline visualizer to see the load test results



Now save the project and run the Test, you will be seeing the samples in your configured listeners, here you can find the time taken for each thread sample hit and status of the request served by Server, number of bytes transfered and start time of the samples
Results in a Table


Result in Spline visualizer


Now fiddle with your code to tweak the performance.

Wednesday, June 16, 2010

Compare context menu in Winmerge

I heavily use Beyond compare to compare and merge files. I personally like the BC's context menu option "Select left side to compare" and "Compare to xxx" But one fine day the trial version expired and the only other alternate is WinMerge.


Winmerge also has this option buried deep under the options dialog box.
Open winmerge.exe from C:\Program Files\WinMerge\winmergeU.exe and select Edit-> options


Here you go with the Winmerge's compare To option enabled in context menus

Saturday, June 5, 2010

Where is my iisapp.vbs in Win 2008 Server ?

In sharepoint development iisapp is one of the script which I use heavily to find the application pools running and to recycle a single application pool. This is the usual case in doing development against Win 2003 & IIS 6. While starting the development in Win 2008 server soon it showed me that I'm dealing with a different web server.

Hit the command line console and gave iisapp, it replied that it is not an internal command or invalid command. IIS 7.0 gotta new administration console command called appcmd.

Giving the command "%windir%\system32\inetsrv\appcmd.exe list wp" provides me the information about the running application pools in IIS 7

Yet another tool to learn in a SharePoint developer's life ....

Thursday, April 29, 2010

How to get NT AUTHORITY\Authenticated Users group using .NET object model

Yes obviously I can hard code a string constant for the value and use the string "NT AUTHORITY\Authenticated Users but I hate hard coding values if the object model is rich enough to provide me a way.

Following method will return NT AUTHORITY\Authenticated Users group as a string

public static string GetNTAuthenticatedUsers()
{
return new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null).Translate(typeof(NTAccount)).Value;
}

Wednesday, April 28, 2010

Global Assembly Cache goes empty


While doing the development on a SharePoint machine, it is frequent to deploy the dlls in GAC and resetting the IIS or recycling the application pool. one day the GAC goes empty and all of us sudden we are not able to deploy the library to the GAC. It had a solution of restarting the development machine but this issue is frequent among the team members


Solution for this is to navigate to Start-> Run - >services.msc and find "Indexing services" stop/restart the service and reopen the assembly window. There you go . .. .

Thursday, July 9, 2009

Retrieve list of assemblies from GAC

Did you ever want to retrieve a list of assemblies along with their version in Global assembly cache? This will be helpful whenever we make system wide patching or updating to understand what changes happened in GAC or in case if you are troubleshooting on some other client machine if you want the version info of set of assemblies in that remote box quickly

Then this utility is a must in your toolbox(DumpUtil.exe). This console line application gives us a dump like the following

Sample output text from DumpUtil.exe
...
System.dll (1.1.4322.2407)
System.Configuration.Install.dll (1.1.4322.573)
System.Data.dll (1.1.4322.2365)
System.Data.OracleClient.dll (1.1.4322.2312)
System.Design.dll (1.1.4322.2300)
System.DirectoryServices.dll (1.1.4322.2300)
System.Drawing.dll (1.1.4322.2327)
System.Drawing.Design.dll (1.1.4322.573)
System.EnterpriseServices.dll (1.1.4322.2326)
System.EnterpriseServices.Thunk.dll (1.1.4322.2326)
...

Related link: http://aravindrises.blogspot.com/2008/08/want-to-take-dll-backup-from-gac.html