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 .
Fixed in master
Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.