diff --git a/src/AssemblyMetadata.Generators/AssemblyMetadataGenerator.cs b/src/AssemblyMetadata.Generators/AssemblyMetadataGenerator.cs index 75c6cf8..2393f94 100644 --- a/src/AssemblyMetadata.Generators/AssemblyMetadataGenerator.cs +++ b/src/AssemblyMetadata.Generators/AssemblyMetadataGenerator.cs @@ -52,7 +52,7 @@ private static GeneratorContext SemanticTransform(GeneratorAttributeSyntaxContex if (attribute.ConstructorArguments.Length == 1) { // remove Assembly - if (name.StartsWith("Assembly")) + if (name.Length > 8 && name.StartsWith("Assembly")) name = name.Substring(8); // remove Attribute diff --git a/src/AssemblyMetadata.Generators/AssemblyMetadataWriter.cs b/src/AssemblyMetadata.Generators/AssemblyMetadataWriter.cs index dac69d6..47b85c1 100644 --- a/src/AssemblyMetadata.Generators/AssemblyMetadataWriter.cs +++ b/src/AssemblyMetadata.Generators/AssemblyMetadataWriter.cs @@ -61,6 +61,7 @@ private static string SafeName(string name) private static string SafeValue(string value) { return value + .Replace("\\", "\\\\") .Replace("\"", "\\\"") .Replace(Environment.NewLine, "\\r\\n"); } diff --git a/test/AssemblyMetadata.Generators.Tests/AssemblyMetadata.Generators.Tests.csproj b/test/AssemblyMetadata.Generators.Tests/AssemblyMetadata.Generators.Tests.csproj index d35dc1a..22d933c 100644 --- a/test/AssemblyMetadata.Generators.Tests/AssemblyMetadata.Generators.Tests.csproj +++ b/test/AssemblyMetadata.Generators.Tests/AssemblyMetadata.Generators.Tests.csproj @@ -14,7 +14,7 @@ Source generator for project and assembly information - as constants in the global "AssemblyMetadata" class + as constants in the global "AssemblyMetadata" \ class Copyright © $([System.DateTime]::Now.ToString(yyyy)) LoreSoft LoreSoft