Dec 23, 2008

FireBug Developer tool Tip

Scenario1: To determine which style sheet or css class is applied to HTML element at runtime. (Figure 1)
Scenario2: How to debug css class? (Figure 2)

Solution:
  1. Download FireFox 3
  2. Download FireBug Add-in
  3. Open firefox, Start > Run > Firefox
  4. Open web site by typing URL
  5. Right click on page and click “inspect element”
  6. Refer below two screen shots

Figure 1

Figure 2

Launching Visual Studio 2005/2008 faster

Ever thought why visual studio takes so much time for loading. Following are two reasons.

1. Start Page gets list of recent projects
2. Start Page connects to internet and get latest visual studio news and headlines and other crap.

Solution: Disable start page from loading when you are launching visual studio.
Start > Run > devenv > Tools > Options > Enviornment > Startup >
a. Set "Show Empty enviornment" in "At startup" dropdown.
b. Uncheck "Download content in every 60 minutes.

See below screen shot for settings.


If you still want to access start page, then go to View > Other windows > Start Page


Nov 3, 2008

Chrome at its best

How to search directly in website?
Let’s say you are searching for latest “wss vhd”, so in classic fashion you would either go to google.com or download.microsoft.com

How does chrome saves time and improve efficiency?
You just need to type “keyword” (I will tell you later what it is), and then followed by query in address bar. See screen shot below

Example: download.microsoft.com

Another example: support.microsoft.com



Manage Search in chrome:
Chrome > Options > Basic tab> Default search > Manage > Add
Enter some user friendly Name: download.microsoft.com
Enter Keyword(this would appear in address bar): download.microsoft.com
URL: Enter valid url and replace query with %s.
http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=%s&DisplayLang=en&sortCriteria=date&nr=20



Oct 17, 2008

Request format is unrecognized for URL unexpectedly ending in

Scenario/problem: Browse service.asmx on localhost and click on any webmethod, you get error as shown below.




Solution: This problem may be due to many reasons.
1..NET Framework version 2.0 and 1.1 by default disables web services HTTP GET, HTTP POST and SOAP protocols. Click here to see details on how to enable this http://support.microsoft.com/default.aspx?scid=kb;en-us;819267

2.After making changes mentioned above, if problem persist than add all protocols in web.config to get exact error. Hopefully this will give you exact error details
< name="HttpSoap">
< name="HttpPost">
< name="HttpGet"> 
< name="HttpPostLocalhost">
< name="Documentation">

Sep 13, 2008

Chrome fans

Yes I think am :)

A very cool feature in chrome i.e. “Find” (Ctrl+F), as you can see on vertical scrollbars there are indications of text found




How to rename SharePoint_AdminContent_someGUID database?

Problem:

  1. Unable to specify config database name when you install MOSS 2007 / WSS 3.0 with help of wizard psconfiggui.exe(that appear just after SharePoint setup, with check box “Run the SharePoint Products and Technologies Configuration Wizard”). Configuration database name by default has weird naming convention that is “SharePoint_AdminContent_”. Typically in SharePoint it’s called configdb.
  2. Second problem, you are unable to use same database instance for more than one SharePoint farm. Or let’s put in other words, I want to share single SQL server for multiple SharePoint farms (not a best practice but sometimes we have to do :) ).
Solution:
Note: Post installation you are not allowed to rename this database name. 
So only solution left is to configure MOSS 2007 / WSS 3.0 with help of command line, see below steps.
  1. Run SharePoint installation (Server type=complete), uncheck “Run the SharePoint Products and Technologies Configuration wizard now”

  1. Open command prompt Start > run > cmd > cd c:\program files\common files\Microsoft shared\web server extenstions\12\bin
  2. Type following command (text in red color will be as per your environment, rest all should be as-is)
psconfig -cmd configdb create server "SQLServer" database WSS-Farm-configdb user domain\spsetup password "p@ssword" admincontentdatabase WSS-Farm-CentralAdmin

SQLServer: Name of the machine where sql server is installed
WSS-Farm-confidb: Now this is what you are specifying, otherwise if you use wizard it will be “SharePoint_AdminContent_
Domin\spsetup: A domain user that should be member of administrator group of all servers in farm(WFE and DB). Secondly it should have “securityadmin” and “dbcreator” role on SQL server with windows authentication
WSS-Farm-CentralAdmin: Database name of central administration web site.

Finally to complete installation run following commands
psconfig.exe -cmd adminvs -provision -port 12345 -windowsauthprovider onlyusentlm
psconfig.exe -cmd services install
psconfig.exe -cmd secureresources

Note
: Description of above three commands are available here

Aug 25, 2008

BizTalk Developer productivity

Many times BizTalk developer is annoyed by mundane tasks like start/stop/deploy/undeploy/import bindings/host instance restart/terminate instances etc.

Even sometime we miss few task and then struggle why changes are not reflecting in this build.

Here is simple batch file that performs above tasks.
deploy.bat
Open deploy.bat and make changes as per your environment.

Supporting files that you should copy in system32 folder
utils.zip (unzip first and copy to system32 folder)

Apr 6, 2008

Architecture and Design Review

Lately, my management asked me to review one asp.net application from architecture and design perspective.

As usual, I googled it on how and what should be the overall approach. After half a day research I thought review comments can be grouped in following categories.

1. Code quality

2. Design constraints

3. Performance constraints

4. Duplicate code

5. Dependencies

Certainly, I concluded report with summary that highlighted most risky components within application and recommendations on how to mitigate risk.

Now, here is the list of tools and articles that I have used to accomplish this task.

1. To start with, this is the best article: Chapter 4 — Architecture and Design Review of a .NET Application for Performance and Scalability

2. Metrics, metrics and more metrics: Gather and understand as much as you can. Ndpend is great tool, initially you will feel slightly uncomfortable with UI and ocean of information it gives. But hang on there and after some time you will find this tool worthy.

3. SourceMonitor is another good tool to understand cyclomatic complexity of application.

4. To know memory leak and slowest lines of code in application use ANTS Profiler.

5. Duplicate code, here is magic wand. “Simian - Similarity Analyser”. You have a liberty to specify number of lines of duplicate code you would like to check(threshold property)

To know recommendations and efforts spent on this activity, leave a comment on this post!

Cheers!

Mar 2, 2008

Google's answer to Windows Sharepoint services (WSS)

Here comes Google with its innovative products line and this time it has well targeted Microsoft SharePoint services (more or less same). If your company is not interested in investment and looking for a neat collaboration platform then consider yourself lucky. There are two products namely http://sites.google.com and http://www.google.com/apps

They have some great features like:-
1. Site creation
2. Page creation
3. Customization
4. Upload files
5. Custom list
6. Templates
7. Authorization (contributors, owners, readers)
8. Email Alerts
9. Search
10. Docs, excel, PowerPoint
11. Calendars
12. Instant messaging (IM)

It has a growing number of customer as well, to name few Capgemini, Procter & Gamble, GE, and Salesforce.com



http://sites.google.comhttp://www.google.com/apps

Feb 19, 2008

MOSS 2007 / WSS 3.0 Performance Handbook

This whitepaper is a quick reference for Microsoft office SharePoint Server (MOSS 2007) and Windows SharePoint Services (WSS 3.0) performance and capacity planning. It is a good starting point for those whose who would like to work on these areas.
Download pdf


BizTalk 2006 Performance Handbook

This whitepaper is a quick reference for BizTalk 2006 performance tips and tricks. It is a good starting point for those whose who would like to work on BizTalk 2006 performance issues.
Download pdf




Feb 9, 2008

Hide default title column in sharepoint list

In MOSS 2007 or WSS 3.0 sometimes you would like to:

  • Hide 'title' column OR
  • Change 'title' column to optional

Follow these easy steps:-

  1. Enable content type for list:-

    1. GoTo: List > Settings > List settings> Advanced settings

    2. Under “Content Types” change “Allow management of content types?” to “Yes”

    3. Click Ok

  2. Change “Title” column to optional/Hidden.

    1. On “list information” page, click “Item” link under “Content type” section

    2. On “List Content Type Information” page, under columns section click “Title”

    3. On “Change List Content Type Column: Item” page, click “edit column in new window”

    4. Under “Additional Column Settings” Change the “Require that this column contains information:” to “No”

    5. Click “Ok”

    6. Close window

    7. On “Change List Content Type Column: Item” page, under column settings select “hidden”


Feb 7, 2008

Show error details on MOSS / WSS site

Follow these easy steps

  1. Start > Run > inetmgr
  2. Right click on web application for which you want to enable error details.
  3. ASP.NET Tab, copy file location for web.config file
  4. Open file in notepad
  5. Make following changes

Old Value

New value

<SafeMode MaxControls="200" CallStack="false"><SafeMode MaxControls="200" CallStack="true">
<customErrors mode="On" /><customErrors mode="Off" />
<compilation batch="false" debug="false"><compilation batch="true" debug="true">




Jan 15, 2008

MOSS 2007 / WSS 3.0 site on Port 80 Internet and Intranet

Introduction
This post describes on how to configure Microsoft Office SharePoint Server (MOSS) 2007 site on port 80 for internet and intranet scenario.
It has following main five task:-

  1. Create Web application
  2. Extend Web application
  3. Configure IIS 6.0
  4. Alternate access mappings
  5. FQDN entry in DNS server

Prerequisites

  • Stop ‘Default web site’ in IIS 6.0.

Task1: Create Web application
In this task you will create web application.

  1. Central administration > Application Management > Create or Extend web application > Create web application
  2. The below table consists of values which will be required during the course of creating the “MOSS80” web application.

IIS Web Site 1. Create a New Web Site:
Description : ‘MOSS80’
Port : 80
Host Header: MYHOME
Security configuration 1. Authentication provider : NTLM
2. Allow Anonymous Access : No
3. User Security Socket Layer: No
Application Pool 1. Configurable
User name: <DomainAccount>
Password:<password>
Database Name and Authentication Database Server : MYDBSERVER
Database Name: MYHOME_Content_80
SQL Authentication: sa/password

Task2: Extend web application
In this task you will extend existing web application (the one which is created in task1)
  1. Central administration > Application Management > Create or Extend web application > Extend an existing web application
  2. The below table consists of values which will be required during the course of creating the “MOSS80Ex” web application.

IIS Web Site 1. Create a New Web Site:
Description : ‘MOSS80Ex’
Port : 80
Host Header: MYSTUDIO
Security configuration 1. Authentication provider : NTLM
2. Allow Anonymous Access : No
3. User Security Socket Layer: No
Load Balanced URL ZONE : Extranet

Task3: Configure IIS6.0
In this task you will enter additional host header values for two web applications which were created in task 1 and 2.

  1. Start > Run > inetmgr.exe
  2. Right click propertiese on “MOSS80” and then click ‘Advanced’ button as show below.
  3. Click Add and enter port 80 and host header MYHOME.datamatics.com as shown above.
  4. Right click propertiese on “MOSS80Ex” and then click ‘Advanced’ button.
  5. Click Add and enter port 80 and host header MYSTUDIO.datamatics.com as shown below

Task4: Alternate access mappings (AAM)
In this task you will add AAM for ‘MOSS80’ web application in SharePoint administration.

  1. Central administration > Operations > Allternate Acces mappings > Click on http://MYHOME
  2. Click Cancel button
  3. Click “Edit Public Zone URLs” as shown below

Task5: FQDN entry in DNS server
In this task you will enter host(MYHOME/MYSTUDIO) entries in DNS server
Adding Address and Pointer Records. The A record maps a host name to an IP address and the PTR record creates a pointer to the host for reverse lookups. Address and pointer records can be created together using the New Host option or separately using the New Record option.
Create a new host entry with A and PTR records by doing the following:

  1. In DNS Manager, right-click on the zone you want to update and then choose New Host from the pop-up menu. This opens the dialog box shown below.
  2. Enter the host name(MYHOME/MYSTUDIO) and IP address and then select the check Associated PTR Record check box as shown below.
  3. Click Done when you are finished.

That's it, this will enable your MOSS 2007 site on port 80 for internet and intranet scenario.

Jan 14, 2008

How to write quality code? Tip1, StringOperations

  1. Use StringBuilder instead of string variable in case of concatenations.

C# Code (Wrong)

C# Code (Correct)

String xXml = “”;
for(Int32 nRep = 1; nRep<=Reps; nRep++ )
{
sXml += "<Order orderId=""
+ nRep
+ "" orderDate=""
+ DateTime.Now.ToString()
+ "" customerId=""
+ nRep
}

// make sure that the StringBuilder capacity is large enough for the resulting text
StringBuilder oSB = new StringBuilder(165);
for (Int32 nRep = 1; nRep <= Reps; nRep++)
{
oSB.Append("<Order orderId="");
oSB.Append(nRep);
oSB.Append("" orderDate="");
oSB.Append(DateTime.Now.ToString());
oSB.Append("" customerId="");
oSB.Append(nRep);
}

Note:

  • Use + When the Number of Appends Is Known or Fixed (String str = str1+str2+str3)
  • The StringBuilder class starts with a default initial capacity of 16. Strings less than the initial capacity are stored in the StringBuilder object.

  1. Use the Overloaded Compare Method for Case-Insensitive String Comparisons as shown below.

C# Code (Wrong)

C# Code (Correct)

// Bad way for insensitive operations because ToLower creates temporary strings
String str="New York";
String str2 = "New york";
if (str.ToLower()==str2.ToLower())
// do something

str.Compare(str, str2, false);

Useful links on string:-

Jan 13, 2008

Presentation and Demo C# Code

Here is the presenation and demo C# code for session held on 11-Jan-07 on following topics:-

  1. Singleton pattern
  2. MVC pattern
  3. Visual Studio Class diagrams
  4. .NET code best practices

Jan 6, 2008

.NET Knowledge sharing session

Topic: .NET Knowledge sharing session
Target Audience: Developers
Date: 11-Jan-07 - Friday
Time: 12:00 to 13:30
Venue: MIDC 3 Conference room
Speaker: Marshal Nagpal

Agenda:

  • Singleton pattern
  • MVC Pattern
  • VS.NET 2005 Class diagrams
  • .NET coding best practices

p.s. Participants should seek approval from concern PM.

EAI project Knowledge sharing

Topic: EAI project Knowledge sharing / lessons learnt
Target Audience: PM, TL, TA
Date: 10-Jan-07 - Thursday
Time: 12:00 to 13:30
Venue: MIDC 3 Conference room
Speaker: Marshal Nagpal

Agenda:

  • Introduction
  • Client background
  • Problem statement / Project overview
  • System integration (Typical EAI project)
  • Solution recommendation
    • Microsoft BizTalk 2006
    • Windows SharePoint Services 3.0
  • Approach
    • Team structure
    • RA
    • Design
    • Implementation
    • Testing
    • UAT
    • External partner
  • Challenges
    • Resources(technology, people, documentation, reference project)
    • Client handling
    • External partner communication
    • Processes (estimation, team collaboration)
  • Lessons learnt

Jan 3, 2008

Kick Off

Now its time to start blogging!
You can say New Year resolution, no actual reason is that few good people
has strongly recommended me to start blogging.

I shall be sharing my experiences on following areas:-

1. Architecture and Design
2. .NET 2.0, 3.0, 3.5
3. SharePoint 2007 and WSS 3.0
4. BizTalk 2006
5. Troubleshooting
6. Best practices in software development

You can subscribe to this blog via Email or
 RSS.