222 references to SR
Microsoft.Interop.LibraryImportGenerator (222)
Analyzers\AnalyzerDiagnostics.cs (1)
33
return new LocalizableResourceString(resourceName,
SR
.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));
Analyzers\ConvertToLibraryImportAnalyzer.cs (4)
26
GetResourceString(nameof(
SR
.ConvertToLibraryImportTitle)),
27
GetResourceString(nameof(
SR
.ConvertToLibraryImportMessage)),
31
description: GetResourceString(nameof(
SR
.ConvertToLibraryImportDescription)));
141
GeneratorDiagnosticsBag diagnostics = new(new DiagnosticDescriptorProvider(), new MethodSignatureDiagnosticLocations((MethodDeclarationSyntax)method.DeclaringSyntaxReferences[0].GetSyntax()),
SR
.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));
Analyzers\ConvertToLibraryImportFixer.cs (8)
49
(true, true) =>
SR
.Format(
SR
.ConvertToLibraryImportWithSuffixAddUnsafe, suffix),
50
(true, false) =>
SR
.ConvertToLibraryImportAddUnsafe,
51
(false, true) =>
SR
.Format(
SR
.ConvertToLibraryImportWithSuffix, suffix),
52
(false, false) =>
SR
.ConvertToLibraryImport
198
generatedDeclaration = generatedDeclaration.WithAdditionalAnnotations(WarningAnnotation.Create(
SR
.ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode));
244
WarningAnnotation.Create(
SR
.ConvertToLibraryImportMayRequireCustomMarshalling));
Analyzers\CustomMarshallerAttributeAnalyzer.cs (129)
46
GetResourceString(nameof(
SR
.InvalidCustomMarshallerAttributeUsageTitle)),
47
GetResourceString(nameof(
SR
.MarshallerTypeMustSpecifyManagedTypeMessage)),
51
description: GetResourceString(nameof(
SR
.MarshallerTypeMustSpecifyManagedTypeDescription)));
57
GetResourceString(nameof(
SR
.InvalidMarshallerTypeTitle)),
58
GetResourceString(nameof(
SR
.MarshallerTypeMustBeStaticClassOrStructMessage)),
62
description: GetResourceString(nameof(
SR
.MarshallerTypeMustBeStaticClassOrStructDescription)));
68
GetResourceString(nameof(
SR
.InvalidMarshallerTypeTitle)),
69
GetResourceString(nameof(
SR
.ElementMarshallerCannotBeStatefulMessage)),
73
description: GetResourceString(nameof(
SR
.ElementMarshallerCannotBeStatefulDescription)));
79
GetResourceString(nameof(
SR
.InvalidMarshallerTypeTitle)),
80
GetResourceString(nameof(
SR
.TypeMustBeUnmanagedMessage)),
84
description: GetResourceString(nameof(
SR
.TypeMustBeUnmanagedDescription)));
90
GetResourceString(nameof(
SR
.InvalidSignaturesInMarshallerShapeTitle)),
91
GetResourceString(nameof(
SR
.GetPinnableReferenceReturnTypeBlittableMessage)),
95
description: GetResourceString(nameof(
SR
.GetPinnableReferenceReturnTypeBlittableDescription)));
101
GetResourceString(nameof(
SR
.InvalidMarshallerTypeTitle)),
102
GetResourceString(nameof(
SR
.TypeMustHaveExplicitCastFromVoidPointerMessage)),
106
description: GetResourceString(nameof(
SR
.TypeMustHaveExplicitCastFromVoidPointerDescription)));
112
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
113
GetResourceString(nameof(
SR
.StatelessValueInRequiresConvertToUnmanagedMessage)),
117
description: GetResourceString(nameof(
SR
.StatelessValueInRequiresConvertToUnmanagedDescription)));
123
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
124
GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsMessage)),
128
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsDescription)));
134
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
135
GetResourceString(nameof(
SR
.OutRequiresToManagedMessage)),
139
description: GetResourceString(nameof(
SR
.OutRequiresToManagedDescription)));
145
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
146
GetResourceString(nameof(
SR
.StatelessRequiresConvertToManagedMessage)),
150
description: GetResourceString(nameof(
SR
.StatelessRequiresConvertToManagedDescription)));
156
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
157
GetResourceString(nameof(
SR
.LinearCollectionInRequiresCollectionMethodsMessage)),
161
description: GetResourceString(nameof(
SR
.LinearCollectionInRequiresCollectionMethodsDescription)));
167
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
168
GetResourceString(nameof(
SR
.StatelessLinearCollectionInRequiresCollectionMethodsMessage)),
172
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionInRequiresCollectionMethodsDescription)));
178
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
179
GetResourceString(nameof(
SR
.LinearCollectionOutRequiresCollectionMethodsMessage)),
183
description: GetResourceString(nameof(
SR
.LinearCollectionOutRequiresCollectionMethodsDescription)));
189
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
190
GetResourceString(nameof(
SR
.StatelessLinearCollectionOutRequiresCollectionMethodsMessage)),
194
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionOutRequiresCollectionMethodsDescription)));
200
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
201
GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsMessage)),
205
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsDescription)));
211
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
212
GetResourceString(nameof(
SR
.CallerAllocFromManagedMustHaveBufferSizeMessage)),
216
description: GetResourceString(nameof(
SR
.CallerAllocFromManagedMustHaveBufferSizeDescription)));
222
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
223
GetResourceString(nameof(
SR
.StatelessLinearCollectionCallerAllocFromManagedMustHaveBufferSizeMessage)),
227
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionCallerAllocFromManagedMustHaveBufferSizeDescription)));
233
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
234
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromManagedMessage)),
238
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromManagedDescription)));
244
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
245
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToUnmanagedMessage)),
249
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToUnmanagedDescription)));
255
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
256
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToManagedMessage)),
260
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToManagedDescription)));
266
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
267
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromUnmanagedMessage)),
271
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromUnmanagedDescription)));
277
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
278
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFreeMessage)),
282
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFreeDescription)));
288
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
289
GetResourceString(nameof(
SR
.FromUnmanagedOverloadsNotSupportedMessage)),
293
description: GetResourceString(nameof(
SR
.FromUnmanagedOverloadsNotSupportedDescription)));
299
GetResourceString(nameof(
SR
.InvalidMarshallerTypeTitle)),
300
GetResourceString(nameof(
SR
.MarshallerTypeMustBeClosedOrMatchArityMessage)),
304
description: GetResourceString(nameof(
SR
.MarshallerTypeMustBeClosedOrMatchArityDescription)));
310
GetResourceString(nameof(
SR
.InvalidMarshallerTypeTitle)),
311
GetResourceString(nameof(
SR
.MarshallerTypeMustBeNonNullMessage)),
315
description: GetResourceString(nameof(
SR
.MarshallerTypeMustBeNonNullDescription)));
321
GetResourceString(nameof(
SR
.InvalidSignaturesInMarshallerShapeTitle)),
322
GetResourceString(nameof(
SR
.FirstParameterMustMatchReturnTypeMessage)),
326
description: GetResourceString(nameof(
SR
.FirstParameterMustMatchReturnTypeDescription)));
332
GetResourceString(nameof(
SR
.InvalidSignaturesInMarshallerShapeTitle)),
333
GetResourceString(nameof(
SR
.ReturnTypesMustMatchMessage)),
337
description: GetResourceString(nameof(
SR
.ReturnTypesMustMatchDescription)));
343
GetResourceString(nameof(
SR
.InvalidSignaturesInMarshallerShapeTitle)),
344
GetResourceString(nameof(
SR
.FirstParametersMustMatchMessage)),
348
description: GetResourceString(nameof(
SR
.FirstParametersMustMatchDescription)));
354
GetResourceString(nameof(
SR
.InvalidSignaturesInMarshallerShapeTitle)),
355
GetResourceString(nameof(
SR
.ElementTypesOfReturnTypesMustMatchMessage)),
359
description: GetResourceString(nameof(
SR
.ElementTypesOfReturnTypesMustMatchDescription)));
365
GetResourceString(nameof(
SR
.InvalidSignaturesInMarshallerShapeTitle)),
366
GetResourceString(nameof(
SR
.ReturnTypeMustBeExpectedTypeMessage)),
370
description: GetResourceString(nameof(
SR
.ReturnTypeMustBeExpectedTypeDescription)));
376
GetResourceString(nameof(
SR
.InvalidManagedTypeTitle)),
377
GetResourceString(nameof(
SR
.ManagedTypeMustBeClosedOrMatchArityMessage)),
381
description: GetResourceString(nameof(
SR
.ManagedTypeMustBeClosedOrMatchArityDescription)));
387
GetResourceString(nameof(
SR
.InvalidManagedTypeTitle)),
388
GetResourceString(nameof(
SR
.ManagedTypeMustBeNonNullMessage)),
392
description: GetResourceString(nameof(
SR
.ManagedTypeMustBeNonNullDescription)));
398
GetResourceString(nameof(
SR
.InvalidMarshalModeTitle)),
399
GetResourceString(nameof(
SR
.MarshalModeMustBeValidEnumValue)),
403
description: GetResourceString(nameof(
SR
.MarshalModeMustBeValidEnumValue)));
416
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
417
GetResourceString(nameof(
SR
.StatelessValueInRequiresConvertToUnmanagedMessage)),
421
description: GetResourceString(nameof(
SR
.StatelessValueInRequiresConvertToUnmanagedDescription)));
427
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
428
GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsMessage)),
432
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsDescription)));
438
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
439
GetResourceString(nameof(
SR
.StatelessRequiresConvertToManagedMessage)),
443
description: GetResourceString(nameof(
SR
.StatelessRequiresConvertToManagedDescription)));
449
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
450
GetResourceString(nameof(
SR
.StatelessLinearCollectionInRequiresCollectionMethodsMessage)),
454
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionInRequiresCollectionMethodsDescription)));
460
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
461
GetResourceString(nameof(
SR
.StatelessLinearCollectionOutRequiresCollectionMethodsMessage)),
465
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionOutRequiresCollectionMethodsDescription)));
471
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
472
GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsMessage)),
476
description: GetResourceString(nameof(
SR
.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsDescription)));
482
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
483
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromManagedMessage)),
487
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromManagedDescription)));
493
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
494
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToUnmanagedMessage)),
498
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToUnmanagedDescription)));
504
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
505
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToManagedMessage)),
509
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresToManagedDescription)));
515
GetResourceString(nameof(
SR
.CustomMarshallerTypeMustHaveRequiredShapeTitle)),
516
GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromUnmanagedMessage)),
520
description: GetResourceString(nameof(
SR
.StatefulMarshallerRequiresFromUnmanagedDescription)));
Analyzers\CustomMarshallerAttributeFixer.cs (2)
84
return CodeAction.Create(
SR
.AddMissingCustomTypeMarshallerMembers, ct => Task.FromResult(symbolEditor.ChangedSolution));
123
SR
.AddMissingCustomTypeMarshallerMembers,
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (3)
246
SR
.ResourceManager,
264
libraryImportAttr, symbol.Name,
SR
.InvalidStringMarshallingConfigurationMissingCustomType);
271
libraryImportAttr, symbol.Name,
SR
.InvalidStringMarshallingConfigurationNotCustom);
Analyzers\NativeMarshallingAttributeAnalyzer.cs (9)
27
GetResourceString(nameof(
SR
.InvalidNativeMarshallingAttributeUsageTitle)),
28
GetResourceString(nameof(
SR
.EntryPointTypeMustHaveCustomMarshallerAttributeWithMatchingManagedTypeMessage)),
32
description: GetResourceString(nameof(
SR
.EntryPointTypeMustHaveCustomMarshallerAttributeWithMatchingManagedTypeDescription)));
37
GetResourceString(nameof(
SR
.InvalidNativeMarshallingAttributeUsageTitle)),
38
GetResourceString(nameof(
SR
.EntryPointTypeMustBeNonNullMessage)),
42
description: GetResourceString(nameof(
SR
.EntryPointTypeMustBeNonNullDescription)));
47
GetResourceString(nameof(
SR
.InvalidNativeMarshallingAttributeUsageTitle)),
48
GetResourceString(nameof(
SR
.GenericEntryPointMarshallerTypeMustBeClosedOrMatchArityMessage)),
52
description: GetResourceString(nameof(
SR
.GenericEntryPointMarshallerTypeMustBeClosedOrMatchArityDescription)));
GeneratorDiagnostics.cs (64)
36
GetResourceString(nameof(
SR
.InvalidLibraryImportAttributeUsageTitle)),
37
GetResourceString(nameof(
SR
.InvalidAttributedMethodSignatureMessageLibraryImport)),
41
description: GetResourceString(nameof(
SR
.InvalidAttributedMethodDescriptionLibraryImport)));
47
GetResourceString(nameof(
SR
.InvalidLibraryImportAttributeUsageTitle)),
48
GetResourceString(nameof(
SR
.InvalidAttributedMethodContainingTypeMissingModifiersMessageLibraryImport)),
52
description: GetResourceString(nameof(
SR
.InvalidAttributedMethodDescriptionLibraryImport)));
58
GetResourceString(nameof(
SR
.InvalidLibraryImportAttributeUsageTitle)),
59
GetResourceString(nameof(
SR
.InvalidStringMarshallingConfigurationMessageLibraryImport)),
63
description: GetResourceString(nameof(
SR
.InvalidStringMarshallingConfigurationDescription)));
69
GetResourceString(nameof(
SR
.TypeNotSupportedTitle)),
70
GetResourceString(nameof(
SR
.TypeNotSupportedMessageParameterLibraryImport)),
74
description: GetResourceString(nameof(
SR
.TypeNotSupportedDescriptionLibraryImport)));
80
GetResourceString(nameof(
SR
.TypeNotSupportedTitle)),
81
GetResourceString(nameof(
SR
.TypeNotSupportedMessageReturnLibraryImport)),
85
description: GetResourceString(nameof(
SR
.TypeNotSupportedDescriptionLibraryImport)));
91
GetResourceString(nameof(
SR
.TypeNotSupportedTitle)),
92
GetResourceString(nameof(
SR
.TypeNotSupportedMessageParameterWithDetails)),
96
description: GetResourceString(nameof(
SR
.TypeNotSupportedDescriptionLibraryImport)));
102
GetResourceString(nameof(
SR
.TypeNotSupportedTitle)),
103
GetResourceString(nameof(
SR
.TypeNotSupportedMessageReturnWithDetails)),
107
description: GetResourceString(nameof(
SR
.TypeNotSupportedDescriptionLibraryImport)));
113
GetResourceString(nameof(
SR
.ConfigurationNotSupportedTitleLibraryImport)),
114
GetResourceString(nameof(
SR
.ConfigurationNotSupportedMessageParameterLibraryImport)),
118
description: GetResourceString(nameof(
SR
.ConfigurationNotSupportedDescriptionLibraryImport)));
124
GetResourceString(nameof(
SR
.ConfigurationNotSupportedTitleLibraryImport)),
125
GetResourceString(nameof(
SR
.ConfigurationNotSupportedMessageReturnLibraryImport)),
129
description: GetResourceString(nameof(
SR
.ConfigurationNotSupportedDescriptionLibraryImport)));
135
GetResourceString(nameof(
SR
.ConfigurationNotSupportedTitleLibraryImport)),
136
GetResourceString(nameof(
SR
.MarshalAsConfigurationNotSupportedMessageParameterLibraryImport)),
140
description: GetResourceString(nameof(
SR
.ConfigurationNotSupportedDescriptionLibraryImport)));
146
GetResourceString(nameof(
SR
.ConfigurationNotSupportedTitleLibraryImport)),
147
GetResourceString(nameof(
SR
.MarshalAsConfigurationNotSupportedMessageReturnLibraryImport)),
151
description: GetResourceString(nameof(
SR
.ConfigurationNotSupportedDescriptionLibraryImport)));
157
GetResourceString(nameof(
SR
.ConfigurationNotSupportedTitleLibraryImport)),
158
GetResourceString(nameof(
SR
.ConfigurationNotSupportedMessageLibraryImport)),
162
description: GetResourceString(nameof(
SR
.ConfigurationNotSupportedDescriptionLibraryImport)));
168
GetResourceString(nameof(
SR
.ConfigurationNotSupportedTitleLibraryImport)),
169
GetResourceString(nameof(
SR
.ConfigurationNotSupportedMessageValueLibraryImport)),
173
description: GetResourceString(nameof(
SR
.ConfigurationNotSupportedDescriptionLibraryImport)));
179
GetResourceString(nameof(
SR
.ConfigurationNotSupportedTitleLibraryImport)),
180
GetResourceString(nameof(
SR
.ConfigurationNotSupportedMessageMarshallingInfoLibraryImport)),
184
description: GetResourceString(nameof(
SR
.ConfigurationNotSupportedDescriptionLibraryImport)));
190
GetResourceString(nameof(
SR
.CannotForwardToDllImportTitle)),
191
GetResourceString(nameof(
SR
.CannotForwardToDllImportMessage)),
195
description: GetResourceString(nameof(
SR
.CannotForwardToDllImportDescription)));
201
GetResourceString(nameof(
SR
.RequiresAllowUnsafeBlocksTitleLibraryImport)),
202
GetResourceString(nameof(
SR
.RequiresAllowUnsafeBlocksMessageLibraryImport)),
206
description: GetResourceString(nameof(
SR
.RequiresAllowUnsafeBlocksDescriptionLibraryImport)));
212
GetResourceString(nameof(
SR
.RequiresExplicitSafetyModifierTitleLibraryImport)),
213
GetResourceString(nameof(
SR
.RequiresExplicitSafetyModifierMessageLibraryImport)),
217
description: GetResourceString(nameof(
SR
.RequiresExplicitSafetyModifierDescriptionLibraryImport)));
223
GetResourceString(nameof(
SR
.UnnecessaryMarshallingInfoTitle)),
224
GetResourceString(nameof(
SR
.UnnecessaryParameterMarshallingInfoMessage)),
228
description: GetResourceString(nameof(
SR
.UnnecessaryMarshallingInfoDescription)),
238
GetResourceString(nameof(
SR
.UnnecessaryMarshallingInfoTitle)),
239
GetResourceString(nameof(
SR
.UnnecessaryReturnMarshallingInfoMessage)),
243
description: GetResourceString(nameof(
SR
.UnnecessaryMarshallingInfoDescription)),
253
GetResourceString(nameof(
SR
.SizeOfCollectionMustBeKnownAtMarshalTimeTitle)),
254
GetResourceString(nameof(
SR
.SizeOfCollectionMustBeKnownAtMarshalTimeMessageOutParam)),
263
GetResourceString(nameof(
SR
.SizeOfCollectionMustBeKnownAtMarshalTimeTitle)),
264
GetResourceString(nameof(
SR
.SizeOfCollectionMustBeKnownAtMarshalTimeMessageReturnValue)),
273
GetResourceString(nameof(
SR
.LibraryImportUsageDoesNotFollowBestPracticesTitle)),
274
GetResourceString(nameof(
SR
.LibraryImportUsageDoesNotFollowBestPracticesMessageWithDetails)),
315
return new LocalizableResourceString(resourceName,
SR
.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));
LibraryImportGenerator.cs (2)
269
var discardedDiagnostics = new GeneratorDiagnosticsBag(new DiagnosticDescriptorProvider(), locations,
SR
.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));
313
var discardedDiagnostics = new GeneratorDiagnosticsBag(new DiagnosticDescriptorProvider(), pinvokeStub.DiagnosticLocation,
SR
.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));