Lets Learn

Opinion Matters

Archive for the ‘Troubleshooting Basics’ Category

life Saver of a Developer: Troubleshooting Tools

Posted by Ankush on November 11, 2011

Its been a long time since I have posted anything here. Don’t think I am not concerned about it,it’s just that I am really busy with SharePoint 2010..Learning new things a lot..So here comes a new topic to my mind. Actually I really wanted to write a blog on this a long time back. But as they say, it’s never too late 🙂

So what is this blog all about. Day in day out we deal with different development situations and we always get help with some tools or they help us in RAPID. So what I would like to do: Is to prepare a list of all the tools and put it in one place. In case if you  wish to help the community and want to put a link to a good troubleshooting tool,  please leave the link here with a small note and I will add to the list.

The list is going to grow..so please make sure you add this to Favourites….

Here is how it should be :

Process Explorer
http://technet.microsoft.com/en-us/sysinternals/bb896653

Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded

Easy one huh?? But what this tool can also do, to help you know about the Integrity level of a process.  Have a look at this: http://en.wikipedia.org/wiki/Mandatory_Integrity_Control

Named objects, including files, registry keys or even other processes and threads, have an entry in the ACL governing access to them, that defines the minimum integrity level of the process that can use the object. Windows makes sure that a process can write to or delete an object only when its integrity level is equal to or higher than the requested integrity level specified by the object.[2] Additionally, process objects with higher IL are out-of-bounds for even read access.

Consequently, a process cannot interact with another process that has a higher IL. So a process cannot perform functions such as inject a DLL into a higher IL process by using the CreateRemoteThread()API function or send data to a different process by using the WriteProcessMemory() function. However, the higher IL process can execute such functions against the lower IL process.[1] However, they can still communicate by using files, Named pipes, LPC or other shared objects. The shared object must have an integrity level as low as the low IL process and should be shared by both the Low-IL and High-IL process.

Posted in Troubleshooting Basics | Tagged: , , , | Leave a Comment »

.NET Reflector is not free anymore

Posted by Ankush on February 21, 2011

It is really sad when I heard that .NET reflector tool is not free anymore. RedGate company has announced that they will charge 35$ for a “perpetual license”. So, it’s not free. Anyway it’s worth to purchase a license of this beautiful software which has really helped but in case if you are looking for some free “Open Source”, then have a look:

  1. ILSpy , an open-source .NET Assembly browser and decompiler.
  2. Common Compiler Infrastructure (CCI)
  3. Mono Cecil
  4. Kaliro
  5. Dotnet IL Editor (DILE)
  6. Monoflector
  7. http://www.jetbrains.com/resharper/download/index.html
  8. http://blogs.jetbrains.com/dotnet/2011/02/resharper-6-bundles-decompiler-free-standalone-tool-to-follow/

Let us know if you have seen/used any tool instead of .net reflector and It is as good as .NET reflector is.

Posted in Troubleshooting Basics | Tagged: , , , , , | 1 Comment »

Troubleshooting Basics # 1 : Fusion

Posted by Ankush on January 26, 2011

Have you ever come across such a scenario where  .NET assembly is not getting loaded for some reason or it is getting loaded but not showing up the latest things which you added in the assembly. For some reason, it still loading the older assembly.

So how would you troubleshoot this scenario.  I have taken number of .NET interviews and this most of the times goes unanswered so I thought I would write a small post about it.

So how would you to troubleshoot this..There are number of tools which you can use here but today I am going to discuss about a very basic one..Fusion Log

So, what is fusion,Fusion is a process to identify and load the assemblies requested by the .NET application. Now this process can be recorded

and luckily .NET framework comes with a tool that allows you to record the loading process. It records the following

information:

  • Which assembly was requested
  • The location from where it was loaded (It records the complete probing process)
  • any errors
  • etc..

how it works:

Simply go to .NET command prompt and type fuslogvw.exe and enable the log.Basically you need to specify the location to keep the log etc..Once done, run any .net app and check the logs.
It will create the log for each .NET assembly it loads. It will tell you how it probe the assembly.

lets say you don’t have .net framework command prompt, still you can enable it by using the registry editor.

Create a log folder (default: C:\fusionlogs)
Add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\LogPath and set it to the log folder
Set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\LogFailures to 1
Optionally set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\ForceLog to 1
Optionally set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\LogResourceBinds to 1

For more information, visit: http://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.71%29.aspx

Try this tool and see how it can helps you specially debugging the problem of loading .NET assemblies.

next I am going to talk about the problems related to the file system and registry while working in .net application…any guesses????

Posted in Troubleshooting Basics | Tagged: , , , , | Leave a Comment »

 
%d bloggers like this: