Tuesday, March 24, 2015

Third Party dll in SSIS Projects

I came across a requirement to access third party dlls in SSIS Package. which is fairly easy. the tricky part is where to deploy those third party dlls. In almost all the blogs that i came across while search the solution, I was told to deploy them in GAC. Which I don't think ideal solution in all the environment. Let me move to solution directly.

- Create a parameter that hold the directory which has all the third party files.
- Pass the variable name in Script
- In your Script, add following line.
 AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

best place to add this is in PreExecute. This will call the attached event handler whenever it will try to load a third party dll.

And add the related event handler in the same class.

Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
    {
       
        if(args.Name.IndexOf("MyCustomDll1.dll")>0)
            return Assembly.LoadFile(Path.Combine(Variables.SupportDirectory,"MyCustomDll1.dll"));
        else if(args.Name.IndexOf("MyCustomDll2.dll")>0)
            return Assembly.LoadFile(Path.Combine(Variables.SupportDirectory,"MyCustomDll2.dll"));
        else
            return Assembly.GetExecutingAssembly();
    }
It is important to return the executing assembly in else.

 -That's it. now it will load all the dll from the folder that you have specified. You just need to make sure that the files exist in that folder.

Thanks,
HP

Sunday, May 4, 2014

Get DataTable from CSV without OleDb

http://utkarshpuranik.com/2009/11/23/get-datatable-from-csv-without-oledb/

Wednesday, September 12, 2012

Debugging Hang/Crash Dumps

A very good article that can be used to debug hang or crash dumps.
http://www.infosysblogs.com/microsoft/2009/06/troubleshooting_wcf_service_ap.html

you may face certain issues while debugging.
Here is the link that helped me fix the issues that came across my debugging.
http://blogs.msdn.com/b/dougste/archive/2009/02/18/failed-to-load-data-access-dll-0x80004005-or-what-is-mscordacwks-dll.aspx

This will help identify memory leaks by type.
http://stackoverflow.com/questions/9016834/detect-wcf-channel-leaking-using-windbg


http://blogs.msdn.com/b/alikl/archive/2009/02/15/identifying-memory-leak-with-process-explorer-and-windbg.aspx?Redirected=true

To debug 32 bit dump on 64 box.
http://blogs.msdn.com/b/msdnforum/archive/2010/03/14/how-do-i-switch-to-32bit-mode-when-i-use-windbg-to-debug-a-dump-of-a-32bit-application-running-on-an-x64-machine.aspx

http://romikoderbynew.com/2011/05/07/memory-dump-analysisw3wp-iis-process/

Hang dump analysis.
http://codemachine.com/article_rpcchain.html



.load sos
!EEStack
to get full stack trace including managed thread. 
If issue loading sos dll then for  for 4.0 application
.loadby sos clr command should be used.

Follow this blog which has step by step information on how to debug a hang dump.
http://romikoderbynew.com/2011/05/07/memory-dump-analysisw3wp-iis-process/



Copy mscordacwks.dll, sos.dll and clr.dll from target machine and then copy it to your machine and run command
.load  "path of sosdll"
to get rid of sos version mismatch error.

To Load the symbols:
  1. Load the dump file.
  2. Run .symfix
  3. Open the 'Symbol File Path' menu
  4. Add a path to your application's .PDB files
  5. Check the 'reload' checkbox
  6. Run !clrstack -p to dump the stack with parameters.

Thursday, April 12, 2012

Issue with Sencha Combo Box...

Came across an interesting issue with sencha combo box when placed in the toolbar. Issue is that when you click on the combo list will appear just below the drop down for the first time. but after that it will appear at the top left corner of the page.
Spent few hours to fix the issue and was digging in ext js file. luckily came across the link with similar issue. here is the link that i got..


http://www.learnsomethings.com/2011/10/31/strange-extjs-combobox-bug-when-placed-in-toolbar-and-item-is-selected-subsequent-trigger-clicks-move-list-to-top-left-corner-of-the-browser/

Going to try it now!!!

Looking forward to the resolutions.. finger crossed!!!
and it worked like a charm!!!
Cheers
Himal