-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strong name validation failed. (Exception from HRESULT: 0x8013141A) Unable to compile #496
Comments
If you are using .Net core app 2, try removing MySQL.Data package and using only MySqlConnector. |
I tried this (removing MySQL.Data package and using only MySqlConnector.), Then I created a new F# Console Application (.Net 4.7.1),
and now SQLProvider Works ! |
Any progress on this? I've just created an F# .NET Core 3.1 console application and get exactly the same error. Please re-open this issue. What is the solution to this? Can't we use SQLProvider with .NET Core, yet? |
@svdHero what database? If MySql/MariaDb, are you using MySqlConnector? You can use .NET Core, however I don't know the latest status: Typeproviders did use compile-time .NET framework libararies and runtime .NET Core libraries. I assume that is still true. |
@Thorium thanks for your reply. My project file looks like this: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Common.fs" />
...
</ItemGroup>
<ItemGroup>
<PackageReference Include="MySql.Data" Version="8.0.19" />
<PackageReference Include="SQLProvider" Version="1.1.76" />
<PackageReference Include="Suave" Version="2.5.6" />
</ItemGroup>
</Project> The compiler error I get is this:
However, the directory I am using Visual Studio 2019 for compiling the project/solution. |
Ah, I just discovered My fault. I will go and try it with the Connector. |
@Thorium I still get the exact same error message, although I replaced MySql.Data by MySqlConnector and did a [<Literal>]
let resolutionPath = @"C:\Users\XXX\.nuget\packages\mysqlconnector\0.61.0\lib\netstandard2.1"
[<Literal>]
let developmentConnectionString = "Server=localhost;Database=Foo;Uid=Bar;Pwd=Umu;SslMode=Required;AutoEnlist=false;ConvertZeroDatetime=true;"
[<Literal>]
let dbVendor = Common.DatabaseProviderTypes.MYSQL
type sql = SqlDataProvider<
ResolutionPath = resolutionPath,
ConnectionString = developmentConnectionString,
DatabaseVendor = dbVendor
> However, since the compiler error does not mention
, but still
seems weird. Is the compiler still expecting |
Currently the reflection needs all the reference assemblies to be present in one path. So I recommend putting the dlls to a folder under your solution and not trying to use nuget cache location directly. |
I would certainly prefer that. That's always been the case with C# in Visual Studio 2013. Is that something I can do the project or solution file? I am using nuget from inside VS, not paket. |
Exectuing
solved the original problem and the compiler did pick up However, now I get the following error:
@theimowski , is this related to what you said about reflection? What I don't understand is, how this is in line to the official nuget principle from 2017, stating
Rethinking, I'd rather stick with this principle. Is that a no-go for SQLProvider then? And when you say "all the reference assemblies to be present in one path" what exactly does that mean? Do all DLL files have to be in a single folder? |
Currently, yes, in a single folder... There is definitely the issue here, as the .NET reflection needs all the referenced assemblies to be near to work, and there is no way to load the assemblies from the Nuget-cache at the time of the reflection loading. At least I don't know a way, so if there is, I would happy if someone would let me know how. |
So in a nusthell, SQLProvider cannot be used according to the best practice way NuGet is supposed be used. That's a shame. 😞 |
Right. Any ideas on this (or PRs) accepted. :-) Currently SQLProvider probes a few folders of given path, but won't search through the user's whole hard disk. And also another problem is that the NuGet cache path has dlls for all different frameworks. Now, SQLProvider should then know somehow which dll to load per runtime used (may vary on compiletime vs runtime). Doesn't sound very error-prone. |
We've been also thinking if SQLProvider could be multiple different Nuget-packages with hard-coded dependencies, instead of reflection. Like SQLProvider.MySql that would reference the correct libraries directly. Maybe still have the current database-independent solution there as the base-package. This would need some project-packaging refactoring. The initial idea with the existing solution is, that often people are tied to some specific version of the drivers anyway, now they can dynamically select whatever version they like by just having those libraries in resolutionPath folder. |
So, if these are all open questions and there is no solution, yet, how about re-opening this issue? 😉 |
"Strong name validation failed" is not the real issue here. There are duplicates decribing the issue better. |
Yeah, that's what I meant. But if there are already duplicates, then nevermind. Thanks for you help again. I am not sure what to do at this point. |
Paket won't solve the issue directly. |
Ok. Thanks. I guess I will stick to good old manual SQL queries while observing the progress in #645. |
In that case I still recommend MySqlConnector, the performance of the official driver is poor. It almost looks like Oracle wouldn't want MySql to work well on .Net. |
Thanks for the advice. 👍 |
I am new at F#, wondered by so many good things, but also stuck with some problems I can not figure out how to proceed.
I am trying to use the SQLProvider, but this error occurs:
I checked and the DLL are on the correct folder. I also specified a f folder, containing the MySqlConnector.dll and MySql.Data.dll, but it does not compile.
The text was updated successfully, but these errors were encountered: