forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResolveAssemblyReferenceTestFixture.cs
More file actions
3168 lines (2813 loc) · 169 KB
/
Copy pathResolveAssemblyReferenceTestFixture.cs
File metadata and controls
3168 lines (2813 loc) · 169 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Versioning;
using Microsoft.Build.Framework;
using Microsoft.Build.Shared;
using Microsoft.Build.Tasks;
using Microsoft.Build.Tasks.AssemblyDependency;
using Microsoft.Build.Utilities;
using Microsoft.Win32;
using Xunit;
using Xunit.Abstractions;
using FrameworkNameVersioning = System.Runtime.Versioning.FrameworkName;
using NativeMethods = Microsoft.Build.Tasks.NativeMethods;
using SystemProcessorArchitecture = System.Reflection.ProcessorArchitecture;
#nullable disable
namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
{
public class ResolveAssemblyReferenceTestFixture : IDisposable
{
// Create the mocks.
internal static Microsoft.Build.Framework.FileExists fileExists = new Microsoft.Build.Framework.FileExists(FileExists);
internal static Microsoft.Build.Framework.DirectoryExists directoryExists = new Microsoft.Build.Framework.DirectoryExists(DirectoryExists);
internal static Microsoft.Build.Tasks.GetDirectories getDirectories = new Microsoft.Build.Tasks.GetDirectories(GetDirectories);
internal static Microsoft.Build.Tasks.GetAssemblyName getAssemblyName = new Microsoft.Build.Tasks.GetAssemblyName(GetAssemblyName);
internal static Microsoft.Build.Tasks.GetAssemblyMetadata getAssemblyMetadata = new Microsoft.Build.Tasks.GetAssemblyMetadata(GetAssemblyMetadata);
#if FEATURE_WIN32_REGISTRY
internal static Microsoft.Build.Shared.GetRegistrySubKeyNames getRegistrySubKeyNames = new Microsoft.Build.Shared.GetRegistrySubKeyNames(GetRegistrySubKeyNames);
internal static Microsoft.Build.Shared.GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue = new Microsoft.Build.Shared.GetRegistrySubKeyDefaultValue(GetRegistrySubKeyDefaultValue);
#endif
internal static Microsoft.Build.Tasks.GetLastWriteTime getLastWriteTime = new Microsoft.Build.Tasks.GetLastWriteTime(GetLastWriteTime);
internal static Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion = new Microsoft.Build.Tasks.GetAssemblyRuntimeVersion(GetRuntimeVersion);
internal static Microsoft.Build.Tasks.GetAssemblyPathInGac checkIfAssemblyIsInGac = new Microsoft.Build.Tasks.GetAssemblyPathInGac(GetPathForAssemblyInGac);
#if FEATURE_WIN32_REGISTRY
internal static Microsoft.Build.Shared.OpenBaseKey openBaseKey = new Microsoft.Build.Shared.OpenBaseKey(GetBaseKey);
#endif
internal Microsoft.Build.UnitTests.MockEngine.GetStringDelegate resourceDelegate = new Microsoft.Build.UnitTests.MockEngine.GetStringDelegate(AssemblyResources.GetString);
internal static Microsoft.Build.Tasks.IsWinMDFile isWinMDFile = new Microsoft.Build.Tasks.IsWinMDFile(IsWinMDFile);
internal static Microsoft.Build.Tasks.ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader = new Microsoft.Build.Tasks.ReadMachineTypeFromPEHeader(ReadMachineTypeFromPEHeader);
// Performance checks.
internal static Dictionary<string, int> uniqueFileExists = null;
internal static Dictionary<string, int> uniqueGetAssemblyName = null;
internal static bool useFrameworkFileExists = false;
internal const string REDISTLIST = """
<FileList Redist="Microsoft-Windows-CLRCoreComp.4.0" Name=".NET Framework 4" RuntimeVersion="4.0" ToolsVersion="12.0">
<File AssemblyName="Accessibility" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="CustomMarshalers" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="ISymWrapper" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.Build" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.Build.Conversion.v4.0" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.Build.Engine" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.Build.Framework" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.Build.Tasks.v4.0" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.Build.Utilities.v4.0" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.CSharp" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.JScript" Version="10.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.VisualBasic" Version="10.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.VisualBasic.Compatibility" Version="10.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.VisualBasic.Compatibility.Data" Version="10.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.VisualC" Version="10.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="Microsoft.VisualC.STLCLR" Version="2.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="mscorlib" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="PresentationBuildTasks" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="PresentationCore" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="PresentationFramework.Aero" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="PresentationFramework.Classic" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="PresentationFramework" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="PresentationFramework.Luna" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="PresentationFramework.Royale" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="ReachFramework" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="sysglobl" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Activities" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Activities.Core.Presentation" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Activities.DurableInstancing" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Activities.Presentation" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.AddIn.Contract" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.AddIn" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ComponentModel.Composition" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ComponentModel.DataAnnotations" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Configuration" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Configuration.Install" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Core" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.DataSetExtensions" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.Entity.Design" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.Entity" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.Linq" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.OracleClient" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.Services.Client" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.Services.Design" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.Services" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Data.SqlXml" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Deployment" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Design" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Device" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.DirectoryServices.AccountManagement" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.DirectoryServices" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.DirectoryServices.Protocols" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Drawing.Design" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Drawing" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Dynamic" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.EnterpriseServices" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.IdentityModel" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.IdentityModel.Selectors" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.IO.Log" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Management" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Management.Instrumentation" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Messaging" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Net" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Numerics" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Printing" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Runtime.DurableInstancing" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Runtime.Caching" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Runtime.Remoting" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Runtime.Serialization" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Runtime.Serialization.Formatters.Soap" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Security" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceModel.Activation" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceModel.Activities" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceModel.Channels" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceModel.Discovery" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceModel" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceModel.Routing" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceModel.Web" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.ServiceProcess" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Speech" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Transactions" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Abstractions" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.ApplicationServices" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.DataVisualization.Design" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.DataVisualization" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.DynamicData.Design" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.DynamicData" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Entity.Design" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Entity" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Extensions.Design" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Extensions" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Mobile" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.RegularExpressions" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Routing" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Web.Services" Version="4.0.0.0" PublicKeyToken="b03f5f7f11d50a3a" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Windows.Forms.DataVisualization.Design" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Windows.Forms.DataVisualization" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Windows.Forms" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Windows.Input.Manipulations" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Windows.Presentation" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Workflow.Activities" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Workflow.ComponentModel" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Workflow.Runtime" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.WorkflowServices" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Xaml" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Xml" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="System.Xml.Linq" Version="4.0.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="UIAutomationClient" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="UIAutomationClientsideProviders" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="UIAutomationProvider" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="UIAutomationTypes" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="WindowsBase" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="WindowsFormsIntegration" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
<File AssemblyName="XamlBuildTask" Version="4.0.0.0" PublicKeyToken="31bf3856ad364e35" Culture="neutral" ProcessorArchitecture="MSIL" InGac="true" />
</FileList>
""";
protected readonly ITestOutputHelper _output;
public ResolveAssemblyReferenceTestFixture(ITestOutputHelper output)
{
Environment.SetEnvironmentVariable("MSBUILDDISABLEASSEMBLYFOLDERSEXCACHE", "1");
_output = output;
}
public void Dispose()
{
Environment.SetEnvironmentVariable("MSBUILDDISABLEASSEMBLYFOLDERSEXCACHE", null);
}
protected static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString();
protected static readonly string s_myProjectPath = Path.Combine(s_rootPathPrefix, "MyProject");
protected static readonly string s_myVersion20Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v2.0.MyVersion");
protected static readonly string s_myVersion40Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v4.0.MyVersion");
protected static readonly string s_myVersion90Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v9.0.MyVersion");
protected static readonly string s_myVersionPocket20Path = s_myVersion20Path + ".PocketPC";
protected static readonly string s_myMissingAssemblyAbsPath = Path.Combine(s_rootPathPrefix, "MyProject", "MyMissingAssembly.dll");
protected static readonly string s_myMissingAssemblyRelPath = Path.Combine("MyProject", "MyMissingAssembly.dll");
protected static readonly string s_myPrivateAssemblyRelPath = Path.Combine("MyProject", "MyPrivateAssembly.exe");
protected static readonly string s_frameworksPath = Path.Combine(s_rootPathPrefix, "Frameworks");
protected static readonly string s_myComponents2RootPath = Path.Combine(s_rootPathPrefix, "MyComponents2");
protected static readonly string s_myComponentsRootPath = Path.Combine(s_rootPathPrefix, "MyComponents");
protected static readonly string s_myComponents10Path = Path.Combine(s_myComponentsRootPath, "1.0");
protected static readonly string s_myComponents20Path = Path.Combine(s_myComponentsRootPath, "2.0");
protected static readonly string s_myComponentsMiscPath = Path.Combine(s_myComponentsRootPath, "misc");
protected static readonly string s_myComponentsV05Path = Path.Combine(s_myComponentsRootPath, "v0.5");
protected static readonly string s_myComponentsV10Path = Path.Combine(s_myComponentsRootPath, "v1.0");
protected static readonly string s_myComponentsV20Path = Path.Combine(s_myComponentsRootPath, "v2.0");
protected static readonly string s_myComponentsV30Path = Path.Combine(s_myComponentsRootPath, "v3.0");
protected static readonly string s_unifyMeDll_V05Path = Path.Combine(s_myComponentsV05Path, "UnifyMe.dll");
protected static readonly string s_unifyMeDll_V10Path = Path.Combine(s_myComponentsV10Path, "UnifyMe.dll");
protected static readonly string s_unifyMeDll_V20Path = Path.Combine(s_myComponentsV20Path, "UnifyMe.dll");
protected static readonly string s_unifyMeDll_V30Path = Path.Combine(s_myComponentsV30Path, "UnifyMe.dll");
protected static readonly string s_myComponents40ComponentPath = Path.Combine(s_myComponentsRootPath, "4.0Component");
protected static readonly string s_40ComponentDependsOnOnlyv4AssembliesDllPath = Path.Combine(s_myComponents40ComponentPath, "DependsOnOnlyv4Assemblies.dll");
protected static readonly string s_myLibrariesRootPath = Path.Combine(s_rootPathPrefix, "MyLibraries");
protected static readonly string s_myLibraries_V1Path = Path.Combine(s_myLibrariesRootPath, "v1");
protected static readonly string s_myLibraries_V2Path = Path.Combine(s_myLibrariesRootPath, "v2");
protected static readonly string s_myLibraries_V1_EPath = Path.Combine(s_myLibraries_V1Path, "E");
protected static readonly string s_myLibraries_ADllPath = Path.Combine(s_myLibrariesRootPath, "A.dll");
protected static readonly string s_myLibraries_BDllPath = Path.Combine(s_myLibrariesRootPath, "B.dll");
protected static readonly string s_myLibraries_CDllPath = Path.Combine(s_myLibrariesRootPath, "C.dll");
protected static readonly string s_myLibraries_TDllPath = Path.Combine(s_myLibrariesRootPath, "T.dll");
protected static readonly string s_myLibraries_V1_DDllPath = Path.Combine(s_myLibraries_V1Path, "D.dll");
protected static readonly string s_myLibraries_V1_E_EDllPath = Path.Combine(s_myLibraries_V1_EPath, "E.dll");
protected static readonly string s_myLibraries_V2_DDllPath = Path.Combine(s_myLibraries_V2Path, "D.dll");
protected static readonly string s_myLibraries_V1_GDllPath = Path.Combine(s_myLibraries_V1Path, "G.dll");
protected static readonly string s_myLibraries_V2_GDllPath = Path.Combine(s_myLibraries_V2Path, "G.dll");
protected static readonly string s_regress454863_ADllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "A.dll");
protected static readonly string s_regress454863_BDllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "B.dll");
protected static readonly string s_regress444809RootPath = Path.Combine(s_rootPathPrefix, "Regress444809");
protected static readonly string s_regress444809_ADllPath = Path.Combine(s_regress444809RootPath, "A.dll");
protected static readonly string s_regress444809_BDllPath = Path.Combine(s_regress444809RootPath, "B.dll");
protected static readonly string s_regress444809_CDllPath = Path.Combine(s_regress444809RootPath, "C.dll");
protected static readonly string s_regress444809_DDllPath = Path.Combine(s_regress444809RootPath, "D.dll");
protected static readonly string s_regress444809_V2RootPath = Path.Combine(s_regress444809RootPath, "v2");
protected static readonly string s_regress444809_V2_ADllPath = Path.Combine(s_regress444809_V2RootPath, "A.dll");
protected static readonly string s_regress442570_RootPath = Path.Combine(s_rootPathPrefix, "Regress442570");
protected static readonly string s_regress442570_ADllPath = Path.Combine(s_regress442570_RootPath, "A.dll");
protected static readonly string s_regress442570_BDllPath = Path.Combine(s_regress442570_RootPath, "B.dll");
protected static readonly string s_myAppRootPath = Path.Combine(s_rootPathPrefix, "MyApp");
protected static readonly string s_myApp_V05Path = Path.Combine(s_myAppRootPath, "v0.5");
protected static readonly string s_myApp_V10Path = Path.Combine(s_myAppRootPath, "v1.0");
protected static readonly string s_myApp_V20Path = Path.Combine(s_myAppRootPath, "v2.0");
protected static readonly string s_myApp_V30Path = Path.Combine(s_myAppRootPath, "v3.0");
protected static readonly string s_netstandardLibraryDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandardlibrary.dll");
protected static readonly string s_netstandardDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandard.dll");
protected static readonly string s_portableDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "Portable.dll");
protected static readonly string s_systemRuntimeDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "System.Runtime.dll");
protected static readonly string s_dependsOnNuGet_ADllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "A.dll");
protected static readonly string s_dependsOnNuGet_NDllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.dll");
protected static readonly string s_dependsOnNuGet_NExePath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.exe");
protected static readonly string s_dependsOnNuGet_NWinMdPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.winmd");
protected static readonly string s_nugetCache_N_Lib_NDllPath = Path.Combine(s_rootPathPrefix, "NugetCache", "N", "lib", "N.dll");
protected static readonly string s_assemblyFolder_RootPath = Path.Combine(s_rootPathPrefix, "AssemblyFolder");
protected static readonly string s_assemblyFolder_SomeAssemblyDllPath = Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.dll");
/// <summary>
/// Search paths to use.
/// </summary>
private static readonly string[] s_defaultPaths = new string[]
{
"{RawFileName}",
"{CandidateAssemblyFiles}",
s_myProjectPath,
s_myComponentsMiscPath,
s_myComponents10Path,
s_myComponents20Path,
s_myVersion20Path,
@"{Registry:Software\Microsoft\.NetFramework,v2.0,AssemblyFoldersEx}",
"{AssemblyFolders}",
"{HintPathFromItem}"
};
/// <summary>
/// Return the default search paths.
/// </summary>
/// <value></value>
internal string[] DefaultPaths
{
get { return s_defaultPaths; }
}
/// <summary>
/// Start monitoring IO calls.
/// </summary>
internal void StartIOMonitoring()
{
// If tables are present then the corresponding IO function will do some monitoring.
uniqueFileExists = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
uniqueGetAssemblyName = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
}
/// <summary>
/// Stop monitoring IO calls and assert if any unnecessary IO was used.
/// </summary>
/// <param name="ioThreshold">Maximum number of file existence checks per file</param>
internal void StopIOMonitoringAndAssert_Minimal_IOUse(int ioThreshold = 1)
{
// Check for minimal IO in File.Exists.
foreach (var entry in uniqueFileExists)
{
string path = (string)entry.Key;
int count = (int)entry.Value;
if (count > ioThreshold)
{
string message = String.Format("File.Exists() was called {0} times with path {1}.", count, path);
Assert.Fail(message);
}
}
uniqueFileExists = null;
uniqueGetAssemblyName = null;
}
/// <summary>
/// Stop monitoring IO calls and assert if any IO was used.
/// </summary>
internal void StopIOMonitoringAndAssert_Zero_IOUse()
{
// Check for minimal IO in File.Exists.
foreach (var entry in uniqueFileExists)
{
string path = (string)entry.Key;
int count = (int)entry.Value;
if (count > 0)
{
string message = String.Format("File.Exists() was called {0} times with path {1}.", count, path);
Assert.Fail(message);
}
}
// Check for zero IO in GetAssemblyName.
foreach (var entry in uniqueGetAssemblyName)
{
string path = (string)entry.Key;
int count = (int)entry.Value;
if (count > 0)
{
string message = String.Format("GetAssemblyName() was called {0} times with path {1}.", count, path);
Assert.Fail(message);
}
}
uniqueFileExists = null;
uniqueGetAssemblyName = null;
}
internal void StopIOMonitoring()
{
uniqueFileExists = null;
uniqueGetAssemblyName = null;
}
protected static List<string> s_existentFiles = new List<string>
{
Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"),
Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"),
Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"),
Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"),
Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"),
Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"),
Path.Combine(Path.GetTempPath(), @"RawFileNameRelative\System.Xml.dll"),
Path.Combine(Path.GetTempPath(), @"RelativeAssemblyFiles\System.Xml.dll"),
Path.Combine(s_myVersion20Path, "System.Data.dll"),
Path.Combine(s_myVersion20Path, "System.Xml.dll"),
Path.Combine(s_myVersion20Path, "System.Xml.pdb"),
Path.Combine(s_myVersion20Path, "System.Xml.xml"),
Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.dll"),
Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.pdb"),
Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.config"),
Path.Combine(s_myVersion20Path, "xx", "System.Xml.resources.dll"),
Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.dll"),
Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.pdb"),
Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.config"),
Path.Combine(s_rootPathPrefix, s_myPrivateAssemblyRelPath),
Path.Combine(s_myProjectPath, "MyCopyLocalAssembly.dll"),
Path.Combine(s_myProjectPath, "MyDontCopyLocalAssembly.dll"),
Path.Combine(s_myVersion20Path, "BadImage.dll"), // An assembly that will give a BadImageFormatException from GetAssemblyName
Path.Combine(s_myVersion20Path, "BadImage.pdb"),
Path.Combine(s_myVersion20Path, "MyGacAssembly.dll"),
Path.Combine(s_myVersion20Path, "MyGacAssembly.pdb"),
Path.Combine(s_myVersion20Path, "xx", "MyGacAssembly.resources.dll"),
Path.Combine(s_myVersion20Path, "System.dll"),
Path.Combine(s_myVersion40Path, "System.dll"),
Path.Combine(s_myVersion90Path, "System.dll"),
Path.Combine(s_myVersion20Path, "mscorlib.dll"),
Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"),
@"C:\myassemblies\My.Assembly.dll",
Path.Combine(s_myProjectPath, "mscorlib.dll"), // This is an mscorlib.dll that has no metadata (i.e. GetAssemblyName returns null)
Path.Combine(s_myProjectPath, "System.Data.dll"), // This is a System.Data.dll that has the wrong pkt, it shouldn't be matched.
Path.Combine(s_myComponentsRootPath, "MyGrid.dll"), // A vendor component that we should find in the registry.
@"C:\MyComponentsA\CustomComponent.dll", // A vendor component that we should find in the registry.
@"C:\MyComponentsB\CustomComponent.dll", // A vendor component that we should find in the registry.
@"C:\MyWinMDComponents7\MyGridWinMD.winmd",
@"C:\MyWinMDComponents9\MyGridWinMD.winmd",
@"C:\MyWinMDComponents\MyGridWinMD.winmd",
@"C:\MyWinMDComponents2\MyGridWinMD.winmd",
@"C:\MyWinMDComponentsA\CustomComponentWinMD.winmd",
@"C:\MyWinMDComponentsB\CustomComponentWinMD.winmd",
@"C:\MyWinMDComponentsVv1\MyGridWinMD2.winmd",
@"C:\MyWinMDComponentsV1\MyGridWinMD3.winmd",
@"C:\MyRawDropControls\MyRawDropControl.dll", // A control installed by VSREG under v2.0.x86chk
@"C:\MyComponents\HKLM Components\MyHKLMControl.dll", // A vendor component that is installed under HKLM but not HKCU.
@"C:\MyComponents\HKCU Components\MyHKLMandHKCUControl.dll", // A vendor component that is installed under HKLM and HKCU.
@"C:\MyComponents\HKLM Components\MyHKLMandHKCUControl.dll", // A vendor component that is installed under HKLM and HKCU.
@"C:\MyWinMDComponents\HKLM Components\MyHKLMControlWinMD.winmd", // A vendor component that is installed under HKLM but not HKCU.
@"C:\MyWinMDComponents\HKCU Components\MyHKLMandHKCUControlWinMD.winmd", // A vendor component that is installed under HKLM and HKCU.
@"C:\MyWinMDComponents\HKLM Components\MyHKLMandHKCUControlWinMD.winmd", // A vendor component that is installed under HKLM and HKCU.
Path.Combine(s_myComponentsV30Path, "MyControlWithFutureTargetNDPVersion.dll"), // The future version of a component.
Path.Combine(s_myComponentsV20Path, "MyControlWithFutureTargetNDPVersion.dll"), // The current version of a component.
Path.Combine(s_myComponentsV10Path, "MyNDP1Control.dll"), // A control that only has an NDP 1.0 version
Path.Combine(s_myComponentsV20Path, "MyControlWithPastTargetNDPVersion.dll"), // The current version of a component.
Path.Combine(s_myComponentsV10Path, "MyControlWithPastTargetNDPVersion.dll"), // The past version of a component.
@"C:\MyComponentServicePack\MyControlWithServicePack.dll", // The service pack 1 version of the control
@"C:\MyComponentBase\MyControlWithServicePack.dll", // The non-service pack version of the control.
@"C:\MyComponentServicePack2\MyControlWithServicePack.dll", // The service pack 1 version of the control
Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), // A devices mscorlib.
s_myLibraries_ADllPath,
@"c:\MyExecutableLibraries\A.exe",
s_myLibraries_BDllPath,
s_myLibraries_CDllPath,
s_myLibraries_V1_DDllPath,
s_myLibraries_V1_E_EDllPath,
@"c:\RogueLibraries\v1\D.dll",
s_myLibraries_V2_DDllPath,
s_myLibraries_V1_GDllPath,
s_myLibraries_V2_GDllPath,
@"c:\MyStronglyNamed\A.dll",
@"c:\MyWeaklyNamed\A.dll",
@"c:\MyInaccessible\A.dll",
@"c:\MyNameMismatch\Foo.dll",
@"c:\MyEscapedName\=A=.dll",
@"c:\MyEscapedName\__'ASP'dw0024ry.dll",
Path.Combine(s_myAppRootPath, "DependsOnSimpleA.dll"),
@"C:\Regress312873\a.dll",
@"C:\Regress312873\b.dll",
@"C:\Regress312873-2\a.dll",
@"C:\Regress275161\a.dll",
@"C:\Regress317975\a.dll",
@"C:\Regress317975\b.dll",
@"C:\Regress317975\v2\b.dll",
@"c:\Regress313086\mscorlib.dll",
@"c:\V1Control\MyDeviceControlAssembly.dll",
@"c:\V1ControlSP1\MyDeviceControlAssembly.dll",
@"C:\Regress339786\FolderA\a.dll",
@"C:\Regress339786\FolderA\c.dll", // v1 of c
@"C:\Regress339786\FolderB\b.dll",
@"C:\Regress339786\FolderB\c.dll", // v2 of c
@"c:\OldClrBug\MyFileLoadExceptionAssembly.dll",
@"c:\OldClrBug\DependsMyFileLoadExceptionAssembly.dll",
@"c:\Regress563286\DependsOnBadImage.dll",
@"C:\Regress407623\CrystalReportsAssembly.dll",
@"C:\Regress435487\microsoft.build.engine.dll",
@"C:\Regress313747\Microsoft.Office.Interop.Excel.dll",
@"C:\Regress313747\MS.Internal.Test.Automation.Office.Excel.dll",
s_regress442570_ADllPath,
s_regress442570_BDllPath,
s_regress454863_ADllPath,
s_regress454863_BDllPath,
@"C:\Regress393931\A.metadata_dll",
@"c:\Regress387218\A.dll",
@"c:\Regress387218\B.dll",
@"c:\Regress387218\v1\D.dll",
@"c:\Regress387218\v2\D.dll",
@"c:\Regress390219\A.dll",
@"c:\Regress390219\B.dll",
@"c:\Regress390219\v1\D.dll",
@"c:\Regress390219\v2\D.dll",
@"c:\Regress315619\A\MyAssembly.dll",
@"c:\Regress315619\B\MyAssembly.dll",
@"c:\SGenDependeicies\mycomponent.dll",
@"c:\SGenDependeicies\mycomponent.XmlSerializers.dll",
@"c:\SGenDependeicies\mycomponent2.dll",
@"c:\SGenDependeicies\mycomponent2.XmlSerializers.dll",
@"c:\Regress315619\A\MyAssembly.dll",
@"c:\Regress315619\B\MyAssembly.dll",
@"c:\MyRedist\MyRedistRootAssembly.dll",
@"c:\MyRedist\MyOtherAssembly.dll",
@"c:\MyRedist\MyThirdAssembly.dll",
// ==[Related File Extensions Testing]================================================================================================
s_assemblyFolder_SomeAssemblyDllPath,
Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pdb"),
Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.xml"),
Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pri"),
Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.licenses"),
Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.config"),
// ==[Related File Extensions Testing]================================================================================================
// ==[Unification Testing]============================================================================================================
// @"C:\MyComponents\v0.5\UnifyMe.dll", // For unification testing, a version that doesn't exist.
s_unifyMeDll_V10Path,
s_unifyMeDll_V20Path,
s_unifyMeDll_V30Path,
// @"C:\MyComponents\v4.0\UnifyMe.dll",
Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"),
Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"),
Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"),
Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"),
Path.Combine(s_myAppRootPath, "DependsOnWeaklyNamedUnified.dll"),
Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"),
@"C:\Framework\Everett\System.dll",
@"C:\Framework\Whidbey\System.dll",
// ==[Unification Testing]============================================================================================================
// ==[Test assemblies reference higher versions than the current target framework=====================================================
Path.Combine(s_myComponentsMiscPath, "DependsOnOnlyv4Assemblies.dll"), // Only depends on 4.0.0 assemblies
Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), // Is in redist list and is a 9.0 assembly
Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), // Depends on 9.0 assemblies
Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), // Depends on 9.0 assemblies
Path.Combine(s_myComponents10Path, "DependsOn9.dll"), // Depends on 9.0 assemblies
Path.Combine(s_myComponents20Path, "DependsOn9.dll"), // Depends on 9.0 assemblies
s_regress444809_ADllPath,
s_regress444809_V2_ADllPath,
s_regress444809_BDllPath,
s_regress444809_CDllPath,
s_regress444809_DDllPath,
s_40ComponentDependsOnOnlyv4AssembliesDllPath,
@"C:\Regress714052\MSIL\a.dll",
@"C:\Regress714052\X86\a.dll",
@"C:\Regress714052\NONE\a.dll",
@"C:\Regress714052\Mix\a.dll",
@"C:\Regress714052\Mix\a.winmd",
@"C:\Regress714052\MSIL\b.dll",
@"C:\Regress714052\X86\b.dll",
@"C:\Regress714052\NONE\b.dll",
@"C:\Regress714052\Mix\b.dll",
@"C:\Regress714052\Mix\b.winmd",
Path.Combine(s_myComponentsRootPath, "V.dll"),
Path.Combine(s_myComponents2RootPath, "W.dll"),
Path.Combine(s_myComponentsRootPath, "X.dll"),
Path.Combine(s_myComponentsRootPath, "X.pdb"),
Path.Combine(s_myComponentsRootPath, "Y.dll"),
Path.Combine(s_myComponentsRootPath, "Z.dll"),
Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"),
Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"),
// WinMD sample files
@"C:\WinMD\v4\mscorlib.dll", // Fake 4.0 mscorlib so we can actually resolve it for one of the tests. With a version of 4
@"C:\WinMD\v255\mscorlib.dll", // Fake 4.0 mscorlib so we can actually resolve it for one of the tests. With a version of 255
@"C:\WinMD\DotNetAssemblyDependsOnWinMD.dll",
@"C:\WinMD\DotNetAssemblyDependsOn255WinMD.dll",
@"C:\WinMD\SampleWindowsRuntimeAndCLR.Winmd",
@"C:\WinMD\SampleWindowsRuntimeAndCLR.dll",
@"C:\WinMD\SampleWindowsRuntimeAndOther.Winmd",
@"C:\WinMD\SampleWindowsRuntimeOnly.Winmd",
@"C:\WinMD\SampleWindowsRuntimeOnly.dll",
@"C:\WinMD\SampleWindowsRuntimeOnly.pri",
@"C:\WinMD\SampleWindowsRuntimeOnly2.Winmd",
@"C:\WinMD\SampleWindowsRuntimeOnly3.Winmd",
@"C:\WinMD\SampleWindowsRuntimeOnly4.Winmd",
@"C:\WinMD\SampleWindowsRuntimeReferencingSystem.Winmd",
@"C:\WinMD\SampleWindowsRuntimeReferencingSystemDNE.Winmd",
@"C:\WinMD\SampleClrOnly.Winmd",
@"C:\WinMD\SampleBadWindowsRuntime.Winmd",
@"C:\WinMD\WinMDWithVersion255.Winmd",
@"C:\WinMDArchVerification\DependsOnInvalidPeHeader.Winmd",
@"C:\WinMDArchVerification\DependsOnInvalidPeHeader.dll",
@"C:\WinMDArchVerification\DependsOnAmd64.Winmd",
@"C:\WinMDArchVerification\DependsOnAmd64.dll",
@"C:\WinMDArchVerification\DependsOnArm.Winmd",
@"C:\WinMDArchVerification\DependsOnArm.dll",
@"C:\WinMDArchVerification\DependsOnArmv7.Winmd",
@"C:\WinMDArchVerification\DependsOnArmv7.dll",
@"C:\WinMDArchVerification\DependsOnX86.Winmd",
@"C:\WinMDArchVerification\DependsOnX86.dll",
@"C:\WinMDArchVerification\DependsOnAnyCPUUnknown.Winmd",
@"C:\WinMDArchVerification\DependsOnAnyCPUUnknown.dll",
@"C:\WinMDArchVerification\DependsOnIA64.Winmd",
@"C:\WinMDArchVerification\DependsOnIA64.dll",
@"C:\WinMDArchVerification\DependsOnUnknown.Winmd",
@"C:\WinMDArchVerification\DependsOnUnknown.dll",
@"C:\WinMDLib\LibWithWinmdAndNoDll.lib",
@"C:\WinMDLib\LibWithWinmdAndNoDll.pri",
@"C:\WinMDLib\LibWithWinmdAndNoDll.Winmd",
@"C:\FakeSDK\References\Debug\X86\DebugX86SDKWinMD.Winmd",
@"C:\FakeSDK\References\Debug\Neutral\DebugNeutralSDKWinMD.Winmd",
@"C:\FakeSDK\References\CommonConfiguration\x86\x86SDKWinMD.Winmd",
@"C:\FakeSDK\References\CommonConfiguration\Neutral\NeutralSDKWinMD.Winmd",
@"C:\FakeSDK\References\Debug\X86\DebugX86SDKRA.dll",
@"C:\FakeSDK\References\Debug\Neutral\DebugNeutralSDKRA.dll",
@"C:\FakeSDK\References\CommonConfiguration\x86\x86SDKRA.dll",
@"C:\FakeSDK\References\CommonConfiguration\Neutral\NeutralSDKRA.dll",
@"C:\FakeSDK\References\Debug\X86\SDKReference.dll",
@"C:\DirectoryContainsOnlyDll\a.dll",
@"C:\DirectoryContainsdllAndWinmd\b.dll",
@"C:\DirectoryContainsdllAndWinmd\c.winmd",
@"C:\DirectoryContainstwoWinmd\a.winmd",
@"C:\DirectoryContainstwoWinmd\c.winmd",
s_systemRuntimeDllPath,
s_portableDllPath,
s_netstandardLibraryDllPath,
s_netstandardDllPath,
@"C:\SystemRuntime\Regular.dll",
s_dependsOnNuGet_ADllPath,
s_nugetCache_N_Lib_NDllPath,
@"C:\DirectoryTest\A.dll",
@"C:\DirectoryTest\B.dll",
};
/// <summary>
/// Mocked up GetFiles.
/// </summary>
/// <param name="path"></param>
/// <param name="pattern"></param>
/// <returns></returns>
internal static string[] GetFiles(string path, string pattern)
{
if (path.Length > 240)
{
throw new PathTooLongException();
}
string extension = null;
if (pattern == "*.xml")
{
extension = ".xml";
}
else if (pattern == "*.pdb")
{
extension = ".pdb";
}
else
{
Assert.Fail("Unsupported GetFiles pattern " + pattern);
}
ArrayList matches = new ArrayList();
foreach (string file in s_existentFiles)
{
string baseDir = Path.GetDirectoryName(file);
if (String.Equals(baseDir, path, StringComparison.OrdinalIgnoreCase))
{
string fileExtension = Path.GetExtension(file);
if (String.Equals(fileExtension, extension, StringComparison.OrdinalIgnoreCase))
{
matches.Add(file);
}
}
}
return (string[])matches.ToArray(typeof(string));
}
/// <summary>
/// Reads the machine type out of the PEHeader of the native dll
/// </summary>
private static UInt16 ReadMachineTypeFromPEHeader(string dllPath)
{
if (@"C:\WinMDArchVerification\DependsOnInvalidPeHeader.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_INVALID;
}
else if (@"C:\WinMDArchVerification\DependsOnAmd64.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_AMD64;
}
else if (@"C:\WinMDArchVerification\DependsOnX86.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_I386;
}
else if (@"C:\WinMDArchVerification\DependsOnArm.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_ARM;
}
else if (@"C:\WinMDArchVerification\DependsOnArmV7.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_ARMV7;
}
else if (@"C:\WinMDArchVerification\DependsOnIA64.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_IA64;
}
else if (@"C:\WinMDArchVerification\DependsOnUnknown.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_R4000;
}
else if (@"C:\WinMDArchVerification\DependsOnAnyCPUUnknown.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_UNKNOWN;
}
else if (@"C:\WinMD\SampleWindowsRuntimeOnly.dll".Equals(dllPath, StringComparison.OrdinalIgnoreCase))
{
return NativeMethods.IMAGE_FILE_MACHINE_I386;
}
return NativeMethods.IMAGE_FILE_MACHINE_INVALID;
}
/// <summary>
/// Checks to see if the file is a winmd file.
/// </summary>
private static bool IsWinMDFile(string fullPath, GetAssemblyRuntimeVersion getAssemblyRuntimeVersion, FileExists fileExists, out string imageRuntimeVersion, out bool isManagedWinMD)
{
imageRuntimeVersion = getAssemblyRuntimeVersion(fullPath);
isManagedWinMD = false;
if (String.Equals(fullPath, @"C:\WinMD\SampleWindowsRuntimeOnly.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\WinMD\SampleWindowsRuntimeAndCLR.Winmd", StringComparison.OrdinalIgnoreCase))
{
isManagedWinMD = true;
return true;
}
else if (String.Equals(fullPath, @"C:\WinMD\WinMDWithVersion255.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\WinMD\SampleWindowsRuntimeOnly2.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\WinMD\SampleWindowsRuntimeOnly3.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\WinMD\SampleWindowsRuntimeOnly4.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\WinMD\SampleWindowsRuntimeReferencingSystem.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\WinMD\SampleWindowsRuntimeReferencingSystemDNE.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (fullPath.StartsWith(@"C:\MyWinMDComponents", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\FakeSDK\WindowsMetadata\SDKWinMD2.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (fullPath.StartsWith(@"C:\DirectoryContains", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (fullPath.StartsWith(@"C:\WinMDArchVerification", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\FakeSDK\WindowsMetadata\SDKWinMD.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
else if (String.Equals(fullPath, @"C:\WinMDLib\LibWithWinmdAndNoDll.Winmd", StringComparison.OrdinalIgnoreCase))
{
return true;
}
return false;
}
/// <summary>
/// Checks to see if the assemblyName passed in is in the GAC.
/// </summary>
private static string GetPathForAssemblyInGac(AssemblyNameExtension assemblyName, SystemProcessorArchitecture targetProcessorArchitecture, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, FileExists fileExists, bool fullFusionName, bool specificVersion)
{
if (assemblyName.Equals(new AssemblyNameExtension("V, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null")))
{
return null;
}
else if (assemblyName.Equals(new AssemblyNameExtension("W, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null")))
{
return @"C:\MyComponents2\W.dll";
}
else if (assemblyName.Equals(new AssemblyNameExtension("Z, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null")))
{
return null;
}
else if (assemblyName.Equals(new AssemblyNameExtension("X, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null")))
{
return @"C:\MyComponents\X.dll";
}
else if (assemblyName.Equals(new AssemblyNameExtension("Y, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null")))
{
return null;
}
else
{
string gacLocation = null;
#if FEATURE_GAC
if (assemblyName.Version != null)
{
gacLocation = GlobalAssemblyCache.GetLocation(assemblyName, targetProcessorArchitecture, getRuntimeVersion, targetedRuntimeVersion, fullFusionName, fileExists, null, null, specificVersion /* this value does not matter if we are passing a full fusion name*/);
}
#endif
return gacLocation;
}
}
/// <summary>
/// Mock the File.Exists method.
/// </summary>
/// <param name="path">The path to check.</param>
/// <returns>'true' if the file is supposed to exist</returns>
internal static bool FileExists(string path)
{
// For very long paths, File.Exists just returns false
if (path.Length > 240)
{
return false;
}
// Do a real File.Exists to make it throw exceptions for illegal paths.
if (File.Exists(path) && useFrameworkFileExists)
{
return true;
}
// Do IO monitoring if needed.
if (uniqueFileExists != null)
{
string lowerPath = path.ToLower();
if (!uniqueFileExists.ContainsKey(lowerPath))
{
uniqueFileExists[lowerPath] = 0;
}
uniqueFileExists[lowerPath]++;
}
// First, MyMissingAssembly doesn't exist anywhere.
if (path.IndexOf("MyMissingAssembly") != -1)
{
return false;
}
if (!Path.IsPathRooted(path))
{
path = Path.GetFullPath(path);
}
foreach (string file in s_existentFiles)
{
if (String.Equals(path, file, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
// Everything else doesn't exist.
return false;
}
/// <summary>
/// Mock the Directory.Exists method.
/// </summary>
/// <param name="path">The path to check.</param>
/// <returns>'true' if the directory is supposed to exist</returns>
internal static bool DirectoryExists(string path)
{
// Now specify the remaining files.
string[] existentDirs = new string[]
{
s_myVersion20Path,
@"c:\SGenDependeicies",
Path.GetTempPath()
};
foreach (string dir in existentDirs)
{
if (String.Equals(path, dir, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
// Everything else doesn't exist.
return false;
}
/// <summary>
/// A mock delegate for Directory.GetDirectories.
/// </summary>
/// <param name="file">The file path.</param>
/// <param name="file">The file pattern.</param>
/// <returns>A set of subdirectories</returns>
internal static string[] GetDirectories(string path, string pattern)
{
if (path.EndsWith(s_myVersion20Path))
{
string[] paths = new string[] {
Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx")
};
return paths;
}
else if (String.Equals(path, @".", StringComparison.OrdinalIgnoreCase))
{
// Pretend the current directory has a few subfolders.
return new string[] {
Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx")
};
}
return Array.Empty<string>();
}
/// <summary>
/// Given a path return the corosponding CLR runtime version
/// </summary>
/// <param name="path">Path to the file</param>
/// <returns>Image runtime version</returns>
internal static string GetRuntimeVersion(string path)
{
if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeAndCLR.Winmd", StringComparison.OrdinalIgnoreCase))
{
return "WindowsRuntime 1.0, CLR V2.0.50727";
}
else if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeOnly.Winmd", StringComparison.OrdinalIgnoreCase))
{
// Simulate a strongly named assembly.
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\WinMD\WinMDWithVersion255.Winmd", StringComparison.OrdinalIgnoreCase))
{
// Simulate a strongly named assembly.
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeOnly2.Winmd", StringComparison.OrdinalIgnoreCase))
{
// Simulate a strongly named assembly.
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeOnly3.Winmd", StringComparison.OrdinalIgnoreCase))
{
// Simulate a strongly named assembly.
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeOnly4.Winmd", StringComparison.OrdinalIgnoreCase))
{
// Simulate a strongly named assembly.
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeReferencingSystem.Winmd", StringComparison.OrdinalIgnoreCase))
{
// Simulate a strongly named assembly.
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeReferencingSystemDNE.Winmd", StringComparison.OrdinalIgnoreCase))
{
// Simulate a strongly named assembly.
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\WinMD\SampleClrOnly.Winmd", StringComparison.OrdinalIgnoreCase))
{
return "CLR V2.0.50727";
}
else if (String.Equals(path, @"C:\WinMD\SampleBadWindowsRuntime.Winmd", StringComparison.OrdinalIgnoreCase))
{
return "Windows Runtime";
}
else if (String.Equals(path, @"C:\WinMD\SampleWindowsRuntimeAndOther.Winmd", StringComparison.OrdinalIgnoreCase))
{
return "WindowsRuntime 1.0, Other V2.0.50727";
}
else if (String.Equals(path, @"C:\DirectoryContainsOnlyDll\a.dll", StringComparison.OrdinalIgnoreCase))
{
return "V2.0.50727";
}
else if (String.Equals(path, @"C:\DirectoryContainsdllAndWinmd\b.dll", StringComparison.OrdinalIgnoreCase))
{
return "V2.0.50727";
}
else if (String.Equals(path, @"C:\DirectoryContainsdllAndWinmd\c.winmd", StringComparison.OrdinalIgnoreCase))
{
return "WindowsRuntime 1.0";
}
else if (String.Equals(path, @"C:\DirectoryContainstwoWinmd\a.winmd", StringComparison.OrdinalIgnoreCase))
{