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 ...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-07-29 17:56 UTC by Ankit Jain
Modified: 2015-07-30 13:21 UTC (History)
2 users (show)

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


Attachments

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

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.


Create a new report for Bug 32591 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments


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.

Related Links: