ServiceStack:测试OrmLite,安装的NuGet,但我得到的错误" FileNotFoundException异常" [英] ServiceStack: Testing OrmLite, installed with NuGet but I get error "FileNotFoundException"

查看:1174
本文介绍了ServiceStack:测试OrmLite,安装的NuGet,但我得到的错误" FileNotFoundException异常"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过的NuGet安装OrmLite(用于MySQL的)在Visual Studio 2012

I just installed OrmLite (for MySql) via NuGet in Visual Studio 2012.

安装没有经过任何错误,所有的DLL:■似乎要加入参考:

The installation passes without any errors, and all DLL:s seem to be added as reference:

ServiceStack.Common的(3.9.70.0)的结果
ServiceStack.Interfaces的(1.0.0.0) 的结果
ServiceStack.Text的(3.9.70.0)的结果
ServiceStack.OrmLite的(3.9.70.0)

ServiceStack.OrmLite.MySql的(3.9.70.0)的结果

ServiceStack.Common (3.9.70.0)
ServiceStack.Interfaces (1.0.0.0)
ServiceStack.Text (3.9.70.0)
ServiceStack.OrmLite (3.9.70.0)
ServiceStack.OrmLite.MySql (3.9.70.0)

编译提供任何错误。然而,当我跑这条线:

Compile gives no errors. However, when I run this line:

dbConnCommOrm.CreateTableIfNotExists<ModuleSettings>();



然后,我得到这个错误:

Then I get this error:

无法加载文件或程序集ServiceStack.Common,
版本= 3.9.69.0,文化=中性公钥= null或它
依赖关系之一。该系统找不到指定的文件。

Could not load file or assembly 'ServiceStack.Common, Version=3.9.69.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

ServiceStack.Common DLL引用(通过的NuGet)为3.9.70.0版本,所以它不是很。奇怪的是,它无法找到3.9.69.0

The ServiceStack.Common dll references (via NuGet) is version 3.9.70.0 so its not very strange that it cannot find 3.9.69.0.

现在的问题是:为什么我收到安装3.9.70.0当它需要3.9.69.0呢?是不是有什么毛病的NuGet脚本(或不过的作品),或我错过什么?

The question is: why am I getting 3.9.70.0 installed when it requires 3.9.69.0 instead? Is there something wrong with the NuGet "script" (or however that works), or what am I missing?

奇怪的是,即使我上得到一个异常!上面提到的路线,在创建表ModuleSettings正确尽管如此

The weird thing is that even though I get an exception on the line mentioned above, the table "ModuleSettings" is created correctly nonetheless!

此外,下载从GitHub的ZIP文件和提取的DLL从那里不工作之一:
在的 ServiceStack.OrmLite-master\lib 的有三个第一文件(见上文),以及由于某种原因,我发现在ServiceStack.Ormlite.dll的 ServiceStack.OrmLite主\lib /签订的文件夹,但没有的 ServiceStack.OrmLite.MySql.dll 的任何地方的 ZIP压缩文件

Also, downloading the ZIP-file from GitHub and extracting the DLLs from there doesnt work either: In ServiceStack.OrmLite-master\lib there are the three first files (see above), and for some reason I find ServiceStack.Ormlite.dll in ServiceStack.OrmLite-master\lib/signed folder, but there is no ServiceStack.OrmLite.MySql.dll anywhere in the ZIP-file.

我也可以补充一点,在安装了旧版本不工作或者。我想这:
http://www.nuget.org /packages/ServiceStack.OrmLite.MySql/3.9.69

I might also add that installing an older version doesnt work either. I tried this: http://www.nuget.org/packages/ServiceStack.OrmLite.MySql/3.9.69

PM>安装封装ServiceStack.OrmLite.MySql -Version 69年9月3日

PM> Install-Package ServiceStack.OrmLite.MySql -Version 3.9.69

和它仍然安装ServerStack.Common /文本v 3.9.70.0

And it still installed ServerStack.Common/Text v 3.9.70.0

任何提示,将不胜感激=)

Any tips would be appreciated =)

推荐答案

你试过?增加的组件,你的web.config重定向

Have you tried to add an assembly redirect in your web.config?

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="ServiceStack.Common" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.9.70.0" newVersion="3.9.70.0" />
      </dependentAssembly>
   </assemblyBinding>
</runtime>



这可能是因为在你安装的程序包的项目之一是专门找3.9。 69.0版本尚未更新。使用程序集绑定重定向页面应该重写和重定向为组装到70年9月3日版的所有要求。

It could be that one of the items in the package that you installed is specifically looking for the 3.9.69.0 version and has not been updated yet. Using the assembly binding redirect should override that and redirect all request for that assembly to the 3.9.70 version.

修改

这适用于非Web项目也是如此。打开(或增加)的app.config文件,并添加相同的信息。它的<内部一个顶层元素;结构>< /结构> 元素

This works for non web projects as well. Open (or add) an app.config file, and add the same information. It is a top level element inside of the <configuration></configuration> element.

如果一个空app.config文件:

If an empty app.config file:

<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="ServiceStack.Common" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.9.70.0" newVersion="3.9.70.0" />
          </dependentAssembly>
       </assemblyBinding>
    </runtime>
</configuration>

这篇关于ServiceStack:测试OrmLite,安装的NuGet,但我得到的错误&QUOT; FileNotFoundException异常&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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