Calling PdfDocumentRenderer.RenderDocument() with CultureInfo.CurrentCulture = "tr-TR" causes the following exception:
System.Resources.MissingManifestResourceException: Could not find the resource "MigraDoc.DocumentObjectModel.MigraDoc.DocumentObjectModel.Resources.AppResources.resources" among the resources "MigraDocCore.DocumentObjectModel.MigraDoc.DocumentObjectModel.Resources.AppResources.resources" embedded in the assembly "MigraDocCore.DocumentObjectModel", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name.
Root cause is this line in DomValueDescriptorCollection.cs. It should be set to InvariantCultureIgnoreCase.
Hashtable hashTable = new Hashtable(StringComparer.CurrentCultureIgnoreCase);
Migradoc tries to do an index lookup on a ValueDescriptorCollection with "Info", which it lower-cases to "ınfo" (note the dot-less lower-case 'i'), which is not in its hash table.
Stack trace:
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at MigraDocCore.DocumentObjectModel.MigraDoc.DocumentObjectModel.Resources.AppResources.get_InvalidValueName() in PdfSharpCore-master\MigraDocCore.DocumentObjectModel\MigraDoc.DocumentObjectModel.Resources\AppResources.Designer.cs:line 321
at MigraDocCore.DocumentObjectModel.MigraDoc.DocumentObjectModel.Resources.DomSR.InvalidValueName(String name) in PdfSharpCore-master\MigraDocCore.DocumentObjectModel\MigraDoc.DocumentObjectModel.Resources\DomSR.cs:line 46
at MigraDocCore.DocumentObjectModel.Internals.Meta.IsNull(DocumentObject dom, String name) in PdfSharpCore-master\MigraDocCore.DocumentObjectModel\MigraDoc.DocumentObjectModel.Internals\Meta.cs:line 171
at MigraDocCore.DocumentObjectModel.DocumentObject.IsNull(String name) in PdfSharpCore-master\MigraDocCore.DocumentObjectModel\MigraDoc.DocumentObjectModel\DocumentObject.cs:line 184
at MigraDocCore.Rendering.PdfDocumentRenderer.WriteDocumentInformation() in PdfSharpCore-master\MigraDocCore.Rendering\MigraDoc.Rendering\PdfDocumentRenderer.cs:line 260
at MigraDocCore.Rendering.PdfDocumentRenderer.PrepareRenderPages() in PdfSharpCore-master\MigraDocCore.Rendering\MigraDoc.Rendering\PdfDocumentRenderer.cs:line 161
at MigraDocCore.Rendering.PdfDocumentRenderer.RenderDocument() in PdfSharpCore-master\MigraDocCore.Rendering\MigraDoc.Rendering\PdfDocumentRenderer.cs:line 142
at MyCode\LogBuilder.cs:line 153
Calling
PdfDocumentRenderer.RenderDocument()
withCultureInfo.CurrentCulture = "tr-TR"
causes the following exception:Root cause is this line in DomValueDescriptorCollection.cs. It should be set to
InvariantCultureIgnoreCase
.Migradoc tries to do an index lookup on a
ValueDescriptorCollection
with"Info"
, which it lower-cases to"ınfo"
(note the dot-less lower-case 'i'), which is not in its hash table.Stack trace: