I am having problems demonstrating NoStringInterning
[assembly: System.Runtime.CompilerServices.CompilationRelaxations(System.Runtime.CompilerServices.CompilationRelaxations.NoStringInterning)]
class Program
{
static void Main(string[] args)
{
String s1 = "Friday";
String s2 = "Friday";
String s3 = "Friday";
String s4 = "Friday";
String s5 = "Friday";
String s6 = "Friday";
String s7 = "Friday";
String s8 = "Friday";
String s9 = "Friday";
// etc...
Console.WriteLine(Object.ReferenceEquals(s1, s2));
Console.WriteLine(Object.ReferenceEquals(s1, s3));
Console.WriteLine(Object.ReferenceEquals(s1, s4));
Console.WriteLine(Object.ReferenceEquals(s1, s5));
Console.WriteLine(Object.ReferenceEquals(s1, s6));
Console.WriteLine(Object.ReferenceEquals(s1, s7));
Console.WriteLine(Object.ReferenceEquals(s1, s8));
Console.WriteLine(Object.ReferenceEquals(s1, s9));
// etc...
I've tried with .NET CLR 2, 3, 4.. as output all I get is a bunch of True. I am expecting a bunch of False!