1
1
using System ;
2
- using System . Collections . Generic ;
3
2
using System . Diagnostics . CodeAnalysis ;
4
3
using System . IO ;
5
4
using System . Linq ;
@@ -91,6 +90,13 @@ private void InstrumentType(TypeDefinition type)
91
90
if ( ! actualMethod . CustomAttributes . Any ( IsExcludeAttribute ) )
92
91
InstrumentMethod ( method ) ;
93
92
}
93
+
94
+ var ctors = type . GetConstructors ( ) ;
95
+ foreach ( var ctor in ctors )
96
+ {
97
+ if ( ! ctor . CustomAttributes . Any ( IsExcludeAttribute ) )
98
+ InstrumentMethod ( ctor ) ;
99
+ }
94
100
}
95
101
96
102
private void InstrumentMethod ( MethodDefinition method )
@@ -167,7 +173,7 @@ private void InstrumentIL(MethodDefinition method)
167
173
private Instruction AddInstrumentationCode ( MethodDefinition method , ILProcessor processor , Instruction instruction , SequencePoint sequencePoint )
168
174
{
169
175
if ( ! _result . Documents . TryGetValue ( sequencePoint . Document . Url , out var document ) )
170
- {
176
+ {
171
177
document = new Document { Path = sequencePoint . Document . Url } ;
172
178
_result . Documents . Add ( document . Path , document ) ;
173
179
}
@@ -194,7 +200,7 @@ private Instruction AddInstrumentationCode(MethodDefinition method, ILProcessor
194
200
private Instruction AddInstrumentationCode ( MethodDefinition method , ILProcessor processor , Instruction instruction , BranchPoint branchPoint )
195
201
{
196
202
if ( ! _result . Documents . TryGetValue ( branchPoint . Document , out var document ) )
197
- {
203
+ {
198
204
document = new Document { Path = branchPoint . Document } ;
199
205
_result . Documents . Add ( document . Path , document ) ;
200
206
}
0 commit comments