Easily Determining what is the exact Error by using Correlation ID in Sharepoint 2010

Have you encountered an error that looks like this screenshot below?

Well if you develop items in Sharepoint then most probably you had seen that not just once but a lot of times unless you are a really good developer that does not commit any mistakes.

Now you are presented with a GUID without any other information so you might be wondering what the hell that means, so you Googled your problem and saw some solutions on how to determine what does that Correlation ID means by going to the server and in this folder location

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS

and whoalla! you see a ton of logs that Sharepoint had generated over time.

You then opened the log specific to time when your issue happened and to your surprise that GUID is non existent.  To your dismay you searched other logs that are near to the time your issue happened but still there’s not luck.  Well there are other easier means in searching for what you want and that is through the Microsoft SharePoint 2010 Administration Toolkit v2.0.

That toolkit have some of the tools you need for diagnosing issues like such plus more, it has Load Testing Toolkit, User Profile Replication, Content Management Interoperability Services and much more.  Viewing logs is never
been easier as the results are presented in a much meaningful way.  So how do I use the tool to check what that correlation ID means? Well here are the steps:

1. Install the tool in your server or even in your local machine that can connect to that server, installation file can be downloaded here for free.  Once downloaded installation is straightforward.

2. Once installed, its time to create your project.  First find the application on your start menu then go to SharePoint 2010 Administration Toolkit -> SharePoint Diagnostic Studio.  Open that then click new project, you will then be presented with a screen similar to below, put your server name on the text box then hit “Create Project”.  Be patient it will take sometime to process that.

3. Once finished you will be presented with this screen, with some information.  In other slower servers you might see it a bit later and it will show “building report please wait…” but don’t worry its processing at  the background also please take now if there’s no data it retains that message.

4. Now you can start searching for your issue by clicking the search button on top.

5. Populate the needed text boxes and hit OK

6. Now you will be presented with what you are looking for.

Scratch – A programming language that you can let your kids learn

Have you ever imagined teaching a 7-10 year old child a programming language and instill that interest?  Well if you try to teach them C# or VB.Net then I guess they will loose interest in a second but if you really want to start teaching them early then there is a good tool for it which is called Scratch.  Teaching them at an early stage will let them develop that programming skills earlier in life which can leverage them on learning at a later stage.  I still remember when BASIC and Pascal was introduced to me when I was in 3rd year highschool I was 12 then, I was already amazed on what it can do while using a monochrome monitor and a CPU with a Turbo button. The things I learned during that period helped me a lot in developing my Progamming Skills which is my bread and butter now.

Scratch as defined by wikipedia is “an educational programming language  that allows people of any experience background and age to experiment with the concepts of fully versatile computer programming by using an alterable GUI”, it is free and you can download it at http://scratch.mit.edu/. It is a cool new approach in programming that will let a child have that interest as the GUI is a bit intuitive, its colorful and you can navigate and develop by just point and clicks!  It’s like Paint meets Visual Studio.

Scratch was introduced to me by my daughter which apparently they are using at their school, she even have developed some small animations on her own. Its really easy to lean and it is intended especially for 6- to 16-year-olds.  So if you have kids, nieces or nephews try to teach them a skill that you have while they enjoy.

To learn further here are the programming concepts in Scratch
When you load the application you will be presented with 8 main options that you can operate on

Motion - This creates motion to the sprite or model like moving from one location to another or turning based on an angle

Looks - This changes the looks of the sprite, it also objects for displaying output

Sound - Anything related to sounds

Pen - Used for drawing objects programatically

Control - This contains conditional statements, event handlers, and methods used for iteration (looping)


Sensing - This conrtols the input aspects such as keyboard and mouse entries.

Operator - Contains the Mathematical, String, Comparison, Random and Logical Operators

Variables - Contains methods for creating variables and arrays.

Now if you are observant, you may notice that each elements or items are like puzzle shapes, that has a big importance in its UI and let kids know which fits where, so you cannot create a sequence or a condition if the shapes dont fit on the proper place.  To have an idea what I am referring to look at these examples.

Another complicated one

It looks fun right? It may seem too childish for a programming language but look at the different intricate projects that have been developed using Scratch from games, to scientific calculator even 3D Rendering.  You can download an assortment of projects here for reference. So why not give it a try and download it now and teach a child you know.  Good luck!

Visual Studio 2010 Productivity Power Tools Rocks!

I just want to share this free tool from Microsoft that makes my life as a developer really easy and its called Visual Studio 2010 Productivity Power Tools which you can download here.

As defined in the site, Visual Studio 2010 Productivity Power Tools is a set of extensions to Visual Studio Professional (and above) which improves developer productivity. This comprises of different tool set that definitely at least one will be very useful to you.  And here is a list of what is useful for me.  But before we start you need to download and install it you can either go to the Extension Manager like such

and go to online gallery to search for it or download in the link provided above.  Once you have done it, turn on and off the tools you need just by going to Tools -> Options -> Productivity Power Tools and turn on only the things you want remember it cost some memory to enable this.

Now going to my list and a bit of an explatnation on what they do.

Align Assignments

This feature is useful if you want to easily view your variable declarations which was like this before

private string sDomain = GlobalVariables.sDomain();
private string sDefaultOU = GlobalVariables.sDefaultOU();
private string sServiceUser = GlobalVariables.sServiceUser();
private string sServicePassword = GlobalVariables.sServicePassword();

then after typing type Ctrl+Alt+] you will view it like tis

private string sDomain          = GlobalVariables.sDomain();
private string sDefaultOU       = GlobalVariables.sDefaultOU();
private string sServiceUser     = GlobalVariables.sServiceUser();
private string sServicePassword = GlobalVariables.sServicePassword();

Auto Brace Completion

Are you not annoyed if you cant find the other pair of { in your code, now with this feature it will automatically close the following constructs

  • ()
  • {}
  • []
  • <>
  • “”
  • ‘’

Column Guides

Having that issue above of missing brackets, sometimes you are tempted to draw an imaginary line to see where the other pair is, I even remember before when monitors are not yet LCD’s I even use whiteboard markers to get it right, this feature will draw that lines for you.  Just right click on the column you want that line and just go to Guidelines, its the same for removing it as well.

Then you have your line

Ctrl + Click Go To Definition

This feature will enable going to definition of an object by using CTRL + Click, which makes the object a hyperlink.


rather than right click go to definition.

Document Well 2010

This tool certainly have a lots of feature but here are the most important things for me.

1. Vertical tabs, just imagine finding all of those open codes on that old horizontal tabs, isnt that annoying clicking that small arrow on the top right location but with this tool you can view it easily on the side.

to enable this use that annoying arrow on the top right portion of your IDE and select customize

Then tick the check box that says show vertically

2. Pinning tabs, did you not find for that option before where you want to close tabs by selection, before its was only close all and close except this but now you have the option to pin tabs and with that you can close all execpt pinned.

Highlight Current Line

This is self explanatory, it just highlights the current line. I dont know for other developer but for me I find it useful as it gives more visibility on what I want specially when you have thousand lines of codes in a high resolution monitor.  Once its enabled it highlights where you are on your sea of codes.

HTML Copy

I guess this one is one of the best features and the one I used most, It enables you to copy your codes how it is formatted on your IDE (spaces and colours) and paste it as HTML,  imaginge how easy your life will be when you are a blogger where you want to maintain the colors and spaces when you post your blog article, its like that self code aware text editor on CodeProject or Stack Overflow.  Also please note this is not just good for blogging or websites it is good as well for Documentations.

No need for a special copy command here, once you Control + C or right click copy it copies the HTML format

Move Line Up – Down Commands

By pressing Alt + Up Arrow or Alt + Down Arrow keys the selected lines of code will be moved up or down respectively, how cool is that!

Imaging this scenario, you need to bring those lines down

before you have to copy and paste, now you just press Alt + Down Arrow so the whole highlighted codes is moved down below.

Searchable Add Reference Dialog

Dont you just like this one, take note that this is really responsive.  It filters as you type.  Just remember those old days of waiting for that COM Object tab to populate the list of objects you can refer to.

Solution Navigator

Think of it as a beefed up version of Solution Explorer where you can expand the code files to navigate to its classes and even members, you can also filter what shows using that search bar and even view whats only opened, unsaved and edited.

Triple Click

Its one of those small things that make a difference.  This makes selecting never easy and can be achieved by triple clicking a line of code

As a bonus

This is not included in the tool but I really like it, its the power of CTRL + K + D, this formats your entire codes to the proper spacing.  So if you have codes like this

By clicking CTRL + K + D, it will be clean like this

Thats it, so have it a go you wont loose anything.  It will definitely make your coding easy as ever.

Tools to make WMI Programming Easier

If you are doing WMI Programming like what I am doing now for a certain project I currently have, I highly recommend using this tool as defintely it will greatly increase your productivity.

WMI Code Creator - Is a tool that allows you to generate codes that uses WMI such as querying, executing a method, to receiving event notifications.

This one would make your life easier as it will create codes for you in C#, VB or VBScript, it even allows you to execute those codes.  All you have to do is to copy and paste it in your project.

You can also explore the namespaces and their corresponding classes easily complete with description.

Overall its a really good tool, and everything you need will be here.  You can download it here http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en

Another worth mentioning is the WMI Explorer by KS-Soft, it is a tool that allows you to explore everything in WMI which includes management classes, objects and their properties on local or remote machines.

It has a simple interface which lets you view all objects in one window and clicking on an item shows the Instances on the classes and their properties, you can even search items if you have trouble finding what you want.

You can also try your queries before you start coding saving you time on trial and error cases.

Overall its an easy to use and its straightforward, it will be a good tool for exploring easily in one view what are the classes available for you and properties of the instances you might find.

You can view futher information here http://www.ks-soft.net/hostmon.eng/wmi/index.htm

Execute Applications on Remote Systems

Running executable applications remotely is really simple as long as you know the credentials of the remote workstation you want to run it on.

So how would you do that?

Through the use of PsExec. So what is PsExec? PsExec is a telnet-replacement that lets you execute processes on other systems without having to installing a client software. PsExec is free and can be downloaded here.

Once you downloaded it you can easily run command prompt from that directory.

To give you an example lets say I want to run a console application located at “D:MyApplications” named “MyExecutable.exe” at the workstation which has the IP “10.10.1.255”. Now the username for that workstation is “user” and the password is “pass”.

So the command for it will be :

psexec.exe \\10.10.1.255 -u user -p pass -c -f "D:\MyApplications\MyExecutable.exe"

So what does the switches mean?

-u : send the username where the application will run as.
-p : that’s the password of that user.
-c : by using this switch, it copies the specified program in the specified location to the remote system for execution.
-f : if file already exists on the remote system it still copies and overwrites it.

So with a little bit of imagination you can do lots with it like performing command line commands remotely or you can even run it from a C# or VB.Net application.

Like such

VB.Net

Dim sShellCommand = "c:\PsExec\psexec.exe \\10.10.1.255 -u user -p pass -c -f ""D:\MyApplications\MyExecutable.exe"""
Shell(sShellCommand, AppWinStyle.Hide)

C#.Net

System.Diagnostics.Process oProcess = new System.Diagnostics.Process();
oProcess.EnableRaisingEvents = false;
oProcess.StartInfo.FileName = "c:\\PsExec\\psexec.exe";
oProcess.StartInfo.Arguments = "\\\\10.10.1.255 -u user -p pass -c -f \"D:\\MyApplications\\MyExecutable.exe\"";
oProcess.Start();

So if you want to know what are the other switches just type PsExec and you will see all switches you might need

Follow

Get every new post delivered to your Inbox.

Join 774 other followers