如何部署的树莓派2(单声道4 + ARM PROC)npgsql? [英] how to deploy npgsql on Raspberry pi 2 (Mono 4 + ARM proc)?

查看:258
本文介绍了如何部署的树莓派2(单声道4 + ARM PROC)npgsql?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2013(Windows)中生成使用Npgsql和Entity Framework 6小.NET 4.5的应用程序。

I use Visual studio 2013 (Windows) to build a small .NET 4.5 application using Npgsql and Entity Framework 6.

在Windows上,它只是正常工作。
但在Raspbian,应用程序崩溃说,它不能找到npgsql提供商。

On windows it just works fine. But on Raspbian, the app crash saying it cannot find npgsql provider.

   Unhandled Exception:
System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider 'Npgsql'.
  at System.Data.Common.DbProviderFactories.GetFactory (System.String providerInvariantName) [0x00000] in <filename unknown>:0
[...]

在我的覆盆子PI 2。

On my raspberry pi 2.

我已经手动安装单V4.0.2

I have manually installed Mono v4.0.2

我抄我的应用程序包括:

I have copied my app including:

npgsql.dll v2.2.5.0

npgsql.dll v2.2.5.0

npgsql.entityframework同一版本的

npgsql.entityframework same version

mono.security V4.0.2

mono.security v4.0.2

和我的app.config包含:

and my app.config contains :

  <?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <providers>
            <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework" />
    </providers>
  </entityFramework>
  <connectionStrings>
    <add name="minitestEntities" connectionString="metadata=res://*/Model2.csdl|res://*/Model2.ssdl|res://*/Model2.msl;provider=Npgsql;provider connection string=&quot;PORT=5432;TIMEOUT=15;POOLING=True;MINPOOLSIZE=1;MAXPOOLSIZE=20;COMMANDTIMEOUT=20;COMPATIBLE=2.2.5.0;DATABASE=minitest;HOST=10.0.0.1;INTEGRATED SECURITY=True;PASSWORD=azerty;USER ID=theuser&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

所以我想知道如果npgsql librairies正确加载,或者如果引用丢失。

So i'm wondering if npgsql librairies are correctly loaded, or a if a reference is missing.

我发现了如何在最近的单声道+ ARM的环境中使用npgsql没有文档。
这个任何信息将是非常美联社preciated。

I found no docs on how to use npgsql on recent mono + ARM environment. Any info about this would be really appreciated.

推荐答案

好吧,我发现在其他discution解决方案。在同时,我忘了所以这里需要注意其网址的答案:

ok i found the solution in an other discution. In the meanwhile i forgot to note its URL so here the answer :

我们必须手动提供者说明加入到的app.config:

We have to add manually the provider description into app.config :

<system.data>
  <DbProviderFactories>
    <add name="Npgsql Data Provider" 
         invariant="Npgsql" 
         support="FF" 
         description=".Net Framework Data Provider for Postgresql Server" 
         type="Npgsql.NpgsqlFactory, Npgsql, Version=2.2.5.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
  </DbProviderFactories>
</system.data>

版本和PuclicKeyToken必须配合npgsql.dll。
要获取公钥标记,你可以运行code:

The version and PuclicKeyToken MUST match with npgsql.dll. To get the public key token, you can run that code :

typeof(Npgsql.NpgsqlFactory).AssemblyQualifiedName

现在我不知道为什么这一步是没有必要进入Windows,而是必须做的进入Linux ...

Now i have no idea why this step is not necessary into windows, but a have to do into linux...

这篇关于如何部署的树莓派2(单声道4 + ARM PROC)npgsql?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆