Monday, February 13, 2017

windows 7 - How do I find which dll is causing an error?


Background:


Windows 7 with SQL Server 2012 Data Tools & Visual Studio 2010 and 2012 installed.


Trying to create a new SSIS project in Visual Studio and I get the following error:


The type initializer for Microsoft.DataTransformationServices.Project.SharedIcons threw an exception
I am almost certain this is being caused by an incorrect dll in
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies


Question:
Is there any way to trace which dll's are being loaded by an application at run time?


I also tried:


C:>tasklist /m /fi "imagename eq devenv.exe "


but only get the relatively unhelpful result:


Image Name                     PID Modules
========================= ======== ============================================
devenv.exe 2784 ntdll.dll, wow64.dll, wow64win.dll,
wow64cpu.dll
devenv.exe 6836 ntdll.dll, wow64.dll, wow64win.dll,
wow64cpu.dll

Also, I am aware this is not a Visual Studio issue, but one with SSDT-BI which uses VS as it's shell, but there is no SU tag for SSDT-BI.


Answer



This blog post from Scott Hanselman has several techniques for debugging assembly loading errors. I would reccommend both the Fusion Log approach or the Process Explorer approach.


The Assembly Binding Log Viewer (Fusion Log Viewer) should be installed if you have Visual Studio installed. Its installed as part of the Windows SDK. On my machine the path is: c:\program files (x86)\microsoft sdks\windows\v8.0a\bin\NETFX 4.0 Tools\FUSLOGVW.exe From the "Settings" button you can enable "Log all binds to disk" to enable logging.


Once logging is enabled, create the error and click "Refresh" to see all the assemblies that were loaded.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...