Bug 32591 - AssemblyName .ctor doesn't accept quoted PublicKeyToken in the assembly name string
Summary: AssemblyName .ctor doesn't accept quoted PublicKeyToken in the assembly name ...
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2015-07-29 17:56 UTC by Ankit Jain
Modified: 2015-07-30 13:21 UTC (History)
2 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Ankit Jain 2015-07-29 17:56:50 UTC
If the string provided to the AssemblyName constructor is for the form:

"System, Version=, Culture=Neutral, PublicKeyToken='b67a5c561934e089'"

.. with a quoted value for PublicKeyToken, then it throws:

csharp> new AssemblyName("System, Version=, Culture=Neutral, PublicKeyToken='b67a5c561934e089'")
System.IO.FileLoadException: The assembly name is invalid.
  at System.Reflection.AssemblyName..ctor (System.String assemblyName) [0x0003a] in /Users/ankit/dev/mono/mcs/class/corlib/System.Reflection/AssemblyName.cs:97
  at <InteractiveExpressionClass>.Host (System.Object& $retval) <0x108797150 + 0x00048> in <filename unknown>:0
  at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result, System.Boolean& result_set) [0x0003e] in /Users/ankit/dev/mono/mcs/mcs/eval.cs:369
  at Mono.CSharpShell.Evaluate (System.String input) [0x00000] in /Users/ankit/dev/mono/mcs/tools/csharp/repl.cs:383

This works fine on Windows/.net . This form is being used in the MSBuild tests in https://github.com/Microsoft/msbuild/blob/xplat/src/XMakeTasks/UnitTests/ResolveAssemblyReference_Tests.cs#L15602 .
Comment 1 Marek Safar 2015-07-30 13:21:33 UTC
Fixed in master

Note You need to log in before you can comment on or make changes to this bug.