Sign in
Thottam R. Sriram
Development Lead, Hosted Services (Current) Program Manager, CLR Team (2005-2007)
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Tags
No tags have been created or used yet.
Archive
Archives
October 2009
(1)
May 2009
(1)
April 2009
(1)
March 2009
(1)
February 2009
(1)
January 2009
(1)
September 2008
(1)
August 2008
(1)
July 2008
(1)
June 2008
(1)
May 2008
(1)
April 2008
(1)
March 2008
(1)
February 2008
(1)
January 2008
(1)
November 2007
(1)
September 2007
(3)
August 2007
(2)
July 2007
(1)
June 2007
(3)
May 2007
(1)
April 2007
(1)
March 2007
(1)
February 2007
(3)
January 2007
(1)
December 2006
(1)
November 2006
(1)
October 2006
(1)
September 2006
(2)
August 2006
(3)
July 2006
(2)
April 2006
(4)
March 2006
(3)
February 2006
(1)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Thottam R. Sriram
Tell us about your experience with COM interop
Posted
over 7 years ago
by
thottams@microsoft.com
27
Comments
COM interoperability is a very powerful feature in the CLR that bridges the gap between native and managed code. It lets you reuse your existing COM and non-COM native DLL in the managed environment easily. It also lets native code call back to managed...
Thottam R. Sriram
Accessing CreateProcess from C# and VB.NET
Posted
over 7 years ago
by
thottams@microsoft.com
20
Comments
I came across this issue recently. I was trying to access CreateProcess using DLLImport from managed code using C# and VB.Net. Here is my code from C#: using System; using System.Diagnostics; using System.Runtime.InteropServices; public...
Thottam R. Sriram
DBNull and Nullable types
Posted
over 5 years ago
by
thottams@microsoft.com
13
Comments
When we have C# code interacting with the data base you run into this problem. Let me try and explain it. The database has nullable columns and C# has nullable types. For example, let us take a table Employee which has Id (int), name (string) and age...
Thottam R. Sriram
CString and GetLength
Posted
over 4 years ago
by
thottams@microsoft.com
12
Comments
I ran into this problem recently when debugging some native code and thought that it will be good to share this with everyone . CString sampleString = CString(_T( "Sample\0String" ), 14); int len = sampleString.GetLength(); // len is 14 CString...
Thottam R. Sriram
Type forwarding using TypeForwardedTo attribute in Runtime.CompilerServices
Posted
over 7 years ago
by
thottams@microsoft.com
12
Comments
We used this feature to solve a problem internally and I was tempted to blog about this cool feature. Type forwarding allows you to move a type from one assembly to another without having to recompile the application that uses the original assembly. ...
Thottam R. Sriram
Managed Debugging Assistants (MDA's)
Posted
over 7 years ago
by
thottams@microsoft.com
10
Comments
When I read through the responses for the questionnaire below I saw that many users were not aware of MDA’s and that drove the topic for this post. I had written a small sample for a simple MDA which I thought that I will share with everyone. MDA...
Thottam R. Sriram
Two versions of an assembly in an AppDomain
Posted
over 6 years ago
by
thottams@microsoft.com
10
Comments
The CLR binder today allows you to either accidentally or intentionally load two versions of a given assembly in an AppDomain. The pain point of this design is that it fails at run time when specific operations are performed with respect to types that...
Thottam R. Sriram
Introduction to Versioning and BindingRedirect
Posted
over 6 years ago
by
thottams@microsoft.com
9
Comments
I want to share with you this sample that demonstrates how to version an assembly. An AssemblyIdentity consists of five parts: AssemblyName Public key Version Culture Processor Architecture How do you specify all of these...
Thottam R. Sriram
Unhandled Exception handler (UnhandledExceptionEventHandler) to collect more information about unexpected exceptions
Posted
over 5 years ago
by
thottams@microsoft.com
9
Comments
To continue on the exception post from last week I did a bit more research and learnt some more. I thought that I will share that with everyone. We had some interesting conversations in our team about exception handling and the following thought came...
Thottam R. Sriram
Managed C++ and C#
Posted
over 6 years ago
by
thottams@microsoft.com
8
Comments
I tried writing a sample to use managed C++ to interact with managed code and here is my learning. I created the following managed C++ code to wrap existing FLAT API’s in a class that can be called form C#. Managed C++ code: #using <mscorlib...
Thottam R. Sriram
Lang.NET Symposium 2006
Posted
over 7 years ago
by
thottams@microsoft.com
7
Comments
I still remember us planning for this event a few months back. It started off as a small group of people wanting to reinvent the then compiler labs into something bigger. The goal was to get all the right people in a room and have great speakers talk...
Thottam R. Sriram
Overriding a property using new and reflection
Posted
over 7 years ago
by
thottams@microsoft.com
7
Comments
When you override a property using new with a new type there is discrepancy in behavior from C# and reflection. C# is not aware of the property in the base class and it has been overridden by the new property. But reflection is well aware of both the...
Thottam R. Sriram
Diagnostics: Using ETW tracing in .NET 3.5 (EventProviderTraceListener)
Posted
over 5 years ago
by
thottams@microsoft.com
7
Comments
. NET exposes an elegant diagnostics model that can be used by applications. It is a bit confusing to start with. There are a few listeners that exist in the Diagnostics namespace. Some of them are 1. TextWriterTraceListener 2. DefaultTraceListener...
Thottam R. Sriram
Using SetRaiseMethod and GetRaiseMethod and invoking the method dynamically
Posted
over 7 years ago
by
thottams@microsoft.com
6
Comments
The GetRaiseMethod returns null for all events declared with the event keyword as explained in the MSDN help. The documentation apparently is not as verbose as it should have been and we will work on that. The documentation around this is extremely confusing...
Thottam R. Sriram
Passing Generic List and inheritance ...
Posted
over 7 years ago
by
thottams@microsoft.com
6
Comments
I came across this interesting scenario when I was looking into some issues. In a normal method you can pass the derived class instance when a base class instance is expected. In the example below passing dc1 to Method1 shows that you can indeed pass...
Thottam R. Sriram
NTSD and SOS basics
Posted
over 6 years ago
by
thottams@microsoft.com
6
Comments
I wanted to take a very simple console application and use ntsd with SOS to debug it. The example demonstrated very simple operations as setting a break point, viewing the managed stack, stack variables, object instance etc. We can go deeper into...
Thottam R. Sriram
NTSD and SOS – Adding a break point on a method with reference to a specific thread
Posted
over 6 years ago
by
thottams@microsoft.com
5
Comments
I wanted to set a conditional break point from managed code and it was hard to do that using SOS. In the sample below, let us assume that I want to break in to the method ThreadMethod when a specific thread tries to access it. I want to thank Varun Sekhri...
Thottam R. Sriram
Using ILASM and ILDASM
Posted
over 6 years ago
by
thottams@microsoft.com
5
Comments
I wanted to write another small sample to demonstrate how you can use ilasm to modify a compiled assembly. The sample is very simple, but demonstrates the concept well. Let us take App.cs which contains the following code: using System; public...
Thottam R. Sriram
Debugging load problems using fusion log
Posted
over 6 years ago
by
thottams@microsoft.com
5
Comments
Fusion log comes in very handy when you want to understand or debug binding behaviors. Let us take the sample code below. Copy the code to DomSample.cs and compile it. Let us assume for now that the code tries to load some arbitrary assembly “Foo” which...
Thottam R. Sriram
Handling, throwing - exceptions and Clean up on error
Posted
over 5 years ago
by
thottams@microsoft.com
5
Comments
There are four ways to throw an exception in my opinion. They are: 1. Throw a new exception a. throw new ArgumentException( … ); 2. Throw the exception you caught a. throw e; 3. Throw the same exception preserving the stack a. throw;...
Thottam R. Sriram
Using CodeDOM to generate CSharp (C#) and VB code
Posted
over 7 years ago
by
thottams@microsoft.com
5
Comments
I spent sometime to understand CodeDOM and in the process wrote a sample which will help me understand this technology better. I wanted to share the sample I wrote with everyone so that it can be helpful for people getting introduced to this powerful...
Thottam R. Sriram
XMLSerializer, XDocument and LINQ
Posted
over 5 years ago
by
thottams@microsoft.com
5
Comments
I took the sample from my previous post and wanted to use LINQ to query the XML. You can pretty much use the power of SQL on the document object to richly query for things you are looking for. using System; using System.Linq; using System...
Thottam R. Sriram
Asynchronous delegates and callback
Posted
over 4 years ago
by
thottams@microsoft.com
4
Comments
I was debugging some issue related to asynchronous delegates and wanted to share that information with everyone. When you do a BeginInvoke the delegate is invoked on a thread from the thread pool and on completion the callback is also called on...
Thottam R. Sriram
XmlSerialization to generate and consume XML
Posted
over 5 years ago
by
thottams@microsoft.com
4
Comments
I want to talk about Xml Serialization this month. One of the work I was involved in recently required generation of XML and a I came across this wonderful technology which helps you generate and consume XML seamlessly. If you are generating XML...
Thottam R. Sriram
Difference between .cctors and ctors
Posted
over 7 years ago
by
thottams@microsoft.com
4
Comments
A static constructor is called when a direct access to any static member of the class is made. The static constructor cannot be used to create an instance of the class. The following example demonstrates this clearly. When you reflect for constructors...
Page 1 of 2 (50 items)
1
2