// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
@@ -362,8 +369,11 @@ public void References_Versioning_StrongNames2()
...
@@ -362,8 +369,11 @@ public void References_Versioning_StrongNames2()
[Fact]
[Fact]
publicvoidReferences_Versioning_WeakNames1()
publicvoidReferences_Versioning_WeakNames1()
{
{
varc1=Temp.CreateFile(extension:".dll").WriteAllBytes(CreateCSharpCompilationWithMscorlib(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}",assemblyName:"C").EmitToArray());
varc2=Temp.CreateFile(extension:".dll").WriteAllBytes(CreateCSharpCompilationWithMscorlib(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}",assemblyName:"C").EmitToArray());
CreateCSharpCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}",new[]{TestReferences.NetFx.v4_0_30319.mscorlib},assemblyName:"C").EmitToArray());
CreateCSharpCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}",new[]{TestReferences.NetFx.v4_0_30319.mscorlib},assemblyName:"C").EmitToArray());
varresult=CSharpScript.EvaluateAsync($@"
varresult=CSharpScript.EvaluateAsync($@"
#r ""{c1.Path}""
#r ""{c1.Path}""
...
@@ -378,8 +388,11 @@ public void References_Versioning_WeakNames1()
...
@@ -378,8 +388,11 @@ public void References_Versioning_WeakNames1()
[Fact]
[Fact]
publicvoidReferences_Versioning_WeakNames2()
publicvoidReferences_Versioning_WeakNames2()
{
{
varc1=Temp.CreateFile(extension:".dll").WriteAllBytes(CreateCSharpCompilationWithMscorlib(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}",assemblyName:"C").EmitToArray());
varc2=Temp.CreateFile(extension:".dll").WriteAllBytes(CreateCSharpCompilationWithMscorlib(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}",assemblyName:"C").EmitToArray());
CreateCSharpCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}",new[]{TestReferences.NetFx.v4_0_30319.mscorlib},assemblyName:"C").EmitToArray());
CreateCSharpCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}",new[]{TestReferences.NetFx.v4_0_30319.mscorlib},assemblyName:"C").EmitToArray());
varresult=CSharpScript.Create($@"
varresult=CSharpScript.Create($@"
#r ""{c1.Path}""
#r ""{c1.Path}""
...
@@ -395,8 +408,11 @@ public void References_Versioning_WeakNames2()
...
@@ -395,8 +408,11 @@ public void References_Versioning_WeakNames2()
[Fact]
[Fact]
publicvoidReferences_Versioning_WeakNames3()
publicvoidReferences_Versioning_WeakNames3()
{
{
varc1=Temp.CreateFile(extension:".dll").WriteAllBytes(CreateCSharpCompilationWithMscorlib(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}",assemblyName:"C").EmitToArray());
varc2=Temp.CreateFile(extension:".dll").WriteAllBytes(CreateCSharpCompilationWithMscorlib(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}",assemblyName:"C").EmitToArray());
CreateCSharpCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}",new[]{TestReferences.NetFx.v4_0_30319.mscorlib},assemblyName:"C").EmitToArray());
CreateCSharpCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}",new[]{TestReferences.NetFx.v4_0_30319.mscorlib},assemblyName:"C").EmitToArray());
varscript0=CSharpScript.Create($@"
varscript0=CSharpScript.Create($@"
#r ""{c1.Path}""
#r ""{c1.Path}""
...
@@ -545,7 +561,7 @@ public async Task MissingRefrencesAutoResolution()
...
@@ -545,7 +561,7 @@ public async Task MissingRefrencesAutoResolution()
[Fact]
[Fact]
publicvoidHostObjectInInMemoryAssembly()
publicvoidHostObjectInInMemoryAssembly()
{
{
varlib=CreateCSharpCompilationWithMscorlib("public class C { public int X = 1, Y = 2; }","HostLib");
varlib=CreateCSharpCompilation("public class C { public int X = 1, Y = 2; }",new[]{TestReferences.NetFx.v4_0_30319.mscorlib},"HostLib");
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
usingSystem;
usingMicrosoft.CodeAnalysis.CSharp;
usingMicrosoft.CodeAnalysis.CSharp;
usingMicrosoft.CodeAnalysis.VisualBasic;
usingMicrosoft.CodeAnalysis.VisualBasic;
...
@@ -9,28 +10,28 @@ internal static class TestCompilationFactory
...
@@ -9,28 +10,28 @@ internal static class TestCompilationFactory
{
{
// TODO: we need to clean up and refactor CreateCompilationWithMscorlib in compiler tests
// TODO: we need to clean up and refactor CreateCompilationWithMscorlib in compiler tests