Bug 32591

Summary: AssemblyName .ctor doesn't accept quoted PublicKeyToken in the assembly name string
Product: [Mono] Class Libraries Reporter: Ankit Jain <ankit.jain>
Component: mscorlibAssignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: masafa, mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: Untriaged   
Hardware: All   
OS: All   
Tags: 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=10.0.0.0, Culture=Neutral, PublicKeyToken='b67a5c561934e089'"

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

csharp> new AssemblyName("System, Version=10.0.0.0, 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