Closed Shavakan closed 7 years ago
What version of tooling are you using? dotnet --version
Can you upload a simple program including .Csproj, Program.cs, Startup.cs, and DbContext to a new GitGub repository or Gist? I think we will need these to recreate.
At first sight this seems to be an issue with the Csproj or MsBuild tools you are on.
Also, can you try the latest prerelease Pomelo.EntityFrameworkCore.MySq 1.1.1-*, we've made some changes to dependencies since 1.1.0
What is your VS version? MSBuild in vs2017 has a bad support for .net core. We suggest you use Roslyn to build .net core project.
@caleblloyd I think we should add VS version into github issue template.
I'm using VS 2015 Community edition Version 14.0.25431.01 Update 3
, and dotnet --version
shows 1.0.0-preview2-003133
I have tried installing the latest prerelease 1.1.1 version, but the same error persists with a different binary: System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
I'll come back once I write the program that recreates the issue (in a version that I can publish!).
My recommendation is to use VS 2017 RC to upgrade to the latest MSBuild, it interacts better when you are using .NET Core enabled libraries with NET 4.* projects.
Install the ".NET Core and Docker (Preview)" component for VS 2017 RC and it will add the dotnet
CLI Preview4 tooling, which will allow you to dotnet restore
msbuild projects from the command line.
No, I've tried vs2017 it will cause many conflicts when you building .net core project with full .net framework. MSBuild in vs2017 is still in alpha version, it is very unstable so I have downgraded to vs2015.
@Shavakan coyld you show me your project.json
@Kagamine there's definitely some issues to work through once you switch to VS 2017. I have converted a .NET 4.6.2 project over to it though and have it fully working with Kestrel, MVC6, and Pomelo.EntityFrameworkCore.MySql while still providing the full .NET 4.6.2 framework, so it's possible...
I have similar issue, but stacktrace differs:
в MySql.Data.Utility.IsWindows()
в MySql.Data.Serialization.ConnectionSettings..ctor(MySqlConnectionStringBuilder csb)
в MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(String value)
в MySql.Data.MySqlClient.MySqlConnection..ctor(String connectionString)
в Microsoft.EntityFrameworkCore.Storage.Internal.MySqlRelationalConnection.get_DbConnection()
в Microsoft.EntityFrameworkCore.Storage.Internal.MySqlRelationalConnection.<OpenAsync>d__39.MoveNext()
WCF service on .net 4.6.1, latest VS 2017
@sm-g Could you please provide us a repro project, and more information about this issue?
I was trying to reproduce, creating step by step copy of my working solution. Finally I notice, that in fresh solution there is in web.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
which solves the issue.
I have Some Problem
System.BadImageFormatException
em MySql.Data.Utility.IsWindows()
em MySql.Data.Serialization.ConnectionSettings..ctor(MySql.Data.MySqlClient.MySqlConnectionStringBuilder)
em MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(System.String)
em MySql.Data.MySqlClient.MySqlConnection..ctor(System.String)
em Microsoft.EntityFrameworkCore.Storage.Internal.MySqlConnectionSettings+<>c__DisplayClass2_0.<GetSettings>b__0(System.String)
em System.Collections.Concurrent.ConcurrentDictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetOrAdd(System.__Canon, System.Func`2<System.__Canon,System.__Canon>)
how did you solve it?
I have a project Win Forms -> net461, which references another netcore2 project.
Steps to reproduce
Any attempt to query DbContext triggers my issue.
The issue
The exception I am seeing:
Of course the HintPath is correctly stated in .csproj, and the dll (that HintPath points to) is present in {solutionDir}/packages/ .
Further technical details
MySQL version: mariadb 10.2.0 Operating system: Windows 7 x64 Pomelo.EntityFrameworkCore.MySql version: 1.1.0
Other details about my project setup: Target framework: .NET Framework 4.6.1
The only NuGet packages installed are:
I first experienced this issue in an attempt to migrate my existing code base from NHibernate. At first I thought this was due to some dependency collision, so I decided to start a new project. On a fresh new solution, I moved only the source codes and installed packages stated above from scratch (instead of trying to replace NHibernate dependencies & references), but the problem consists.
I looks mysterious to me why a seemingly existing file is reported to be absent. Please inspire me if I'm missing something. Thanks.