Bid is ‘safe’ for InProc SxS, but I’ve added an initial trace line for each AppDomain to make it more human friendly.

                <ds.Bid|Info> VersionSafeName=’<AppDomain.CurrentDomain.FriendlyName>_p#_InstanceID_ad#’

via System.Runtime.Versioning.VersionHelper.MakeVersionSafeName(AppDomain.CurrentDomain.FriendlyName, ResourceScope.Machine, ResourceScope.AppDomain);

example: C78:102: <ds.Bid|Info> VersionSafeName='XdoTracingTest.exe_p192_rOVlOOOEfcORz8ON24OC-ONOLyOGOIOVwOOOJlkOXk_ad1'

C78:102: <ds.DataSet.DataSet|API> 1#

C78:103: <ds.Bid|Info> VersionSafeName='friendly_MyComputer_p192_rOVlOOOEfcORz8ON24OC-ONOLyOGOIOVwOOOJlkOXk_ad2'

C78:103: <ds.DataSet.DataSet|API> 1#

 

Why it’s safe:

                For every managed AppDomain and native Dll that loads, a new unique (recyclable) module id is acquired from the loader via DllBidEntryPoint.

There is only a single loader (aka. AdoNetDiag.dll running in native code) loaded per process.

                Yes, you could be malicious and change the registry key that identifies the loader per DLL load - but that’s not supported scenario.

 

                The Thread ID and Module ID are included with every trace.

                The Module ID is agnostic to the NetFx40 or NetFx35 instance since it is a unique identifiers for the process; the ‘friendly name’ and ad# are not unique to the process.

                Allows a single thread to be followed through the process and different application domains uniquely identified.

                For managed code to be more human friendly, that initial trace point per application domain helps identify the running instance/domain more clearly.

 

Removed the following files to share a common Bid\inc\cs\BidPrivateBase.cs

                Data\System\Data\Common\BidPrivateBase.cs

                DataOracleClient\System\Data\Common\BidPrivateBase.cs

The common file was originally not shared in V2.0 because when the work started

a)      partial class hadn’t been introduced yet

b)      reliability work with constrained execution regions hadn’t been introduced yet

c)       the supposed common code was modified with each copy for individual needs at the time.

 

In bid\inc\cs\bidprivatebase.cs

                Dead code removal relating to tracing.

                Removed the V1 support code

                Added other #defines to “remove unused” code by System.Data.dll , System.Data.OracleClient.dll and System.Data.Entity.dll

Added [ResourceExposure(ResourceScope.None)] to all Bid.NativeMethods since they don’t expose any resources.

 

                Did not add ResourceExposure to modID since it doesn’t expose a resource, it just represents a unique identitifer.

                Similar to how XmlReader doesn’t expose the resource, however its creation with a filename does.

 

I have already checked in the start of a tracing unit test (changeset #629692, #629897)

                It can enable BidStub, BidLabProto or AdoNetDiag for tracing.  AdoNetDiag is the one used by the unit test.

                Then launches a program to traces the 24 permutations of (FullTrust tracing first or partial trust tracing first) and (initial domain tracing first or secondary domain tracing first).

                Remaining work: programmatically analyze the output to verify the expected traces.