How to get line numbers in your code for specific events, viz., exception?

One of my clients came up with a requirement to track down the line of the code immediately when the exception is thrown, note that this is ‘without the use of the debuggers’. My research led me to lot of questions online about this and hence I am trying to write a succinct blog about what…


Enumerating all Modules in a Managed Process

I recently helped a developer that needed to enumerate all of the modules in an arbitrary process. They are given a Process ID (PID) and need to enumerate all of the modules, both native and managed that have been loaded by the process. They started by creating a System.Diagnostics.Process object for the given PID with…

0

Visual Studio 2012 IDE freezes while editing a UML model object

Recently I got an opportunity to work with a customer who was observing some performance issue with their VS2012 IDE intermittently while editing some UML diagrams. More information about the problem assessment is as below: Symptom While trying to edit any UML model in Model Explorer, e.g. editing a sequence diagram/activity diagram/component diagram etc., the…

1

Usage of .NET Collections types in VBScript is not supported after .NET 4.5

While working with a customer, we came across a change in .NET 4.5 around usability of .NET types/classes (e.g., System.Collections.ArrayList) in VBScript. I consider it as one of the major changes in .NET 4.5 (it might have been with .NET 4.0 itself as .NET 4.5 is just an in-place upgrade to .NET 4.0, but this…

1

Finding Assemblies based on the .net runtime version it targets

Recently had a customer who had this requirement to find all .net assemblies which targets .net framework 1.1 on his machine. The reason for this was that they were de-commissioning all .net assemblies that targets .net 1.1. So wrote a simple console application (EnumAssemblies.exe) for this customer, I thought why not share this with others…

2

System.MissingMethodException – Bad profiler changing the method name

Usually System.MissingMethodException exception is thrown when there is an attempt to dynamically access a method that does not exist. Recently we worked on few issues where we saw applications throwing System.MissingMethodException intermittently. In these issues, the method names of the functions were changed by a special prefix “__AW_”. For example, we saw the Exception type…

0

Investigating a GSCookie Corruption

GSCookie helps in finding buffer overrun cases on the stack and terminates the application when this is detected. In the .NET environment this would happen when calling into a native function when the function overrides the buffer on the stack corrupting the GSCookie put in place. Here is a similar case. I have a sample…

0

P/Invoke Marshal.StructuretoPtr

In this blog I am going to talk about Marshal.StructuretoPtr , especially its last parameter fDeleteOld. Although its msdn description is pretty concise but I have seen it to be a source of confusion a lot of times. Following is what it says: fDeleteOld Type: System..::.Booleantrue to have the Marshal..::.DestroyStructure method called on the ptr…

7

.NET-BroadcastEventWindow causing BOOTUP_EXCEPTION_COMPLUS during application shutdown

This is one of the interesting scenario in which an unmanaged application built with Non-Microsoft technology was crashing during application shutdown with BOOTUP_EXCEPTION_COMPLUS exception (c0020001). This unmanaged application happened to be using unmanaged dll (built with Microsoft compiler) which in turn used IJW (a.k.a. C++ Interop) to interact with windows forms and create some ActiveX…

2

Porting C++ native code to managed (/clr) - Threads

In native world, one interacts with OS directly by calling Win32 APIs for managing resources (like allocating/deallocating memory,opening/closing handles). In managed world one  relies on CLR totally or at times partially for doing the same( eg GC does memory management for us).Due to lack of understanding of the way CLR does the work for us,  we may at times conclude…

1