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 ()
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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

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