The tests that compile code are failing on machines with both VS 2015 and VS 2017. They were disabled in 33bf2453f39f8328ef9f0c64ca4f547b0f2e4ee4, but we should investigate the issue and re-enable them. The issue may also go away when we stop using the 4.4.0 contracts.
Any workaround I can use for now?
Test on a machine with only VS 2017. 😄 I also had a hunch that upgrading the test projects to net46 might fix the issue.
It seems there's other issues when upgrading tests to net46 (I also changed all #if NET452 in the test folder to #if NET46). I'll leave the error message here for reference:
Test 'M:Microsoft.EntityFrameworkCore.Design.Tests.Migrations.Design.CSharpMigrationOperationGeneratorTest.SqlOperation_required_args' failed:
Could not load file or assembly 'System.Reflection.Metadata, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
System.IO.FileLoadException: Could not load file or assembly 'System.Reflection.Metadata, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'System.Reflection.Metadata, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
at Microsoft.EntityFrameworkCore.Relational.Design.Specification.Tests.TestUtilities.BuildReference.ByName(String name, Boolean copyLocal)
at Microsoft.EntityFrameworkCore.Relational.Design.Specification.Tests.TestUtilities.BuildSource..ctor()
C:\Repos\EntityFramework\test\Microsoft.EntityFrameworkCore.Design.Tests\Migrations\Design\CSharpMigrationOperationGeneratorTest.cs(1982,0): at Microsoft.EntityFrameworkCore.Design.Tests.Migrations.Design.CSharpMigrationOperationGeneratorTest.Test[T](T operation, String expectedCode, Action`1 assert)
C:\Repos\EntityFramework\test\Microsoft.EntityFrameworkCore.Design.Tests\Migrations\Design\CSharpMigrationOperationGeneratorTest.cs(1934,0): at Microsoft.EntityFrameworkCore.Design.Tests.Migrations.Design.CSharpMigrationOperationGeneratorTest.SqlOperation_required_args()
I'll uninstall VS 2015 and hope for the best.

So far this didn't work:
newVersion=1.1.37.0 in C:\Users\{user}\AppData\Local\Microsoft\VisualStudio\{version}\devenv.exe.config and C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe.configMight be able to add some binding redirects to the test projects (xUnit.net picks them up even though tests are DLLs)
I just:
SqlOperation_required_args testI got:
------ Test started: Assembly: Microsoft.EntityFrameworkCore.Design.Tests.dll ------
Test 'Microsoft.EntityFrameworkCore.Design.Tests.Migrations.Design.CSharpMigrationOperationGeneratorTest.SqlOperation_required_args' failed:
System.IO.FileLoadException : Could not load file or assembly 'System.Collections.Immutable, Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Microsoft.EntityFrameworkCore.Relational.Design.Specification.Tests.TestUtilities.BuildReference.ByName(String name, Boolean copyLocal)
at Microsoft.EntityFrameworkCore.Relational.Design.Specification.Tests.TestUtilities.BuildSource..ctor()
D:\Repos\EntityFramework\test\Microsoft.EntityFrameworkCore.Design.Tests\Migrations\Design\CSharpMigrationOperationGeneratorTest.cs(1951,0): at Microsoft.EntityFrameworkCore.Design.Tests.Migrations.Design.CSharpMigrationOperationGeneratorTest.Test[T](T operation, String expectedCode, Action`1 assert)
D:\Repos\EntityFramework\test\Microsoft.EntityFrameworkCore.Design.Tests\Migrations\Design\CSharpMigrationOperationGeneratorTest.cs(1934,0): at Microsoft.EntityFrameworkCore.Design.Tests.Migrations.Design.CSharpMigrationOperationGeneratorTest.SqlOperation_required_args()
0 passed, 1 failed, 0 skipped, took 2.53 seconds (xUnit.net 2.2.0 build 3545).
I'm going to take a look at fixing this because I'm blocked :(
That one can be fixed with a binding redirect to the right version.
I'll look into this issue next. There are a lot of pieces in play here. It's not going to be fun getting to the bottom of it.
It's working now with a binding redirect to 1.2.1.0 (and not 1.3.1.0, which still breaks!). This is the App.config file I had to put at the root of the test project folder:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.3.1.0" newVersion="1.2.1.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Should I do this for every test project with this problem and send a PR enabling tests, or do you want to look for a better solution?
EDIT: There's also outdated tests because of API changes.
For me, that only fixed the problem on VS2017-only machines. I'll keep looking for a full fix. But at least you can run them locally now. I have a branch with the updated test too.
Thanks :D
On Wed, Mar 1, 2017, 20:06 Brice Lambson notifications@github.com wrote:
For me, that only fixed the problem on VS2017-only machines. I'll keep
looking for a full fix. But at least you can run them locally now. I have a
branch with the updated test too.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/EntityFramework/issues/7620#issuecomment-283550560,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABeg9Io95_5RkxQtvo4aqcOFyjQ3FNY5ks5rhkBOgaJpZM4MCLIO
.
Got to the bottom of it. Binding redirects aren't generated for DLLs. I'll have a fix out soon.