Perché incidente ServiceStack OrmLite ad eccezione null quando aggiungo OrmLite.Firebird?

voti
0

Sto valutando ServiceStack e OrmLite e ho voluto provare con un database Firebird. Utilizzando la ServiceStack.Northwind demo come punto di partenza, quando aggiungo il riferimento ServiceStack.OrmLite.Firebird alle C # riferimenti di montaggio, l'applicazione inizia a mandare in crash all'avvio con un errore di nulla al momento del caricamento di montaggio:

La linea di codice che avviene in a Global.asax.cs:

 public class AppHost : AppHostBase
    {
        public AppHost() : base(Northwind Web Services, typeof(CustomersService).Assembly) {}   // <-- Here!

L'eccezione:

System.TypeLoadException was unhandled by user code
  HResult=-2146233054
  Message=Method 'Execute' in type 'ServiceStack.Host.ServiceController' from assembly 'ServiceStack, Version=4.0.11.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
  Source=ServiceStack
  TypeName=ServiceStack.Host.ServiceController
  StackTrace:
       at ServiceStack.ServiceStackHost..ctor(String serviceName, Assembly[] assembliesWithServices)
       at ServiceStack.AppHostBase..ctor(String serviceName, Assembly[] assembliesWithServices)
       at ServiceStack.Northwind.AppHost..ctor() in C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\ServiceStack.Northwind\Global.asax.cs:line 13
       at ServiceStack.Northwind.Global.Application_Start(Object sender, EventArgs e) in C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\ServiceStack.Northwind\Global.asax.cs:line 31
  InnerException: 

La fonte demo è qui: https://github.com/ServiceStack/ServiceStack.Examples/tree/master/src/ServiceStack.Northwind (cambia solo necessario è quello di eseguire Install-Package ServiceStack.OrmLite.Firebird. Dalla console di gestione dei pacchetti)

Ecco la sessione della console gestore di pacchetti:

Package Manager Console Host Version 3.1.1.0

Type 'get-help NuGet' to see all available NuGet commands.

PM> Install-Package ServiceStack.OrmLite.Firebird
Attempting to gather dependencies information for package 'ServiceStack.OrmLite.Firebird.4.0.44' with respect to project 'ServiceStack.Northwind', targeting '.NETFramework,Version=v4.0'
Attempting to resolve dependencies for package 'ServiceStack.OrmLite.Firebird.4.0.44' with DependencyBehavior 'Lowest'
Resolving actions to install package 'ServiceStack.OrmLite.Firebird.4.0.44'
Resolved actions to install package 'ServiceStack.OrmLite.Firebird.4.0.44'
Removed package 'ServiceStack.Common.4.0.11' from 'packages.config'
Successfully uninstalled 'ServiceStack.Common.4.0.11' from ServiceStack.Northwind
Removed package 'ServiceStack.Interfaces.4.0.11' from 'packages.config'
Successfully uninstalled 'ServiceStack.Interfaces.4.0.11' from ServiceStack.Northwind
Removed package 'ServiceStack.OrmLite.4.0.11' from 'packages.config'
Successfully uninstalled 'ServiceStack.OrmLite.4.0.11' from ServiceStack.Northwind
Removed package 'ServiceStack.Text.4.0.11' from 'packages.config'
Successfully uninstalled 'ServiceStack.Text.4.0.11' from ServiceStack.Northwind
Adding package 'FirebirdSql.Data.FirebirdClient.4.7.0' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'FirebirdSql.Data.FirebirdClient.4.7.0' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'FirebirdSql.Data.FirebirdClient.4.7.0' to 'packages.config'
Successfully installed 'FirebirdSql.Data.FirebirdClient 4.7.0' to ServiceStack.Northwind
Adding package 'ServiceStack.Interfaces.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.Interfaces.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.Interfaces.4.0.44' to 'packages.config'
Successfully installed 'ServiceStack.Interfaces 4.0.44' to ServiceStack.Northwind
Adding package 'ServiceStack.Text.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.Text.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.Text.4.0.44' to 'packages.config'
Successfully installed 'ServiceStack.Text 4.0.44' to ServiceStack.Northwind
Adding package 'ServiceStack.Common.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.Common.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.Common.4.0.44' to 'packages.config'
Successfully installed 'ServiceStack.Common 4.0.44' to ServiceStack.Northwind
Adding package 'ServiceStack.OrmLite.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.OrmLite.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.OrmLite.4.0.44' to 'packages.config'
Successfully installed 'ServiceStack.OrmLite 4.0.44' to ServiceStack.Northwind
Adding package 'ServiceStack.OrmLite.Firebird.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.OrmLite.Firebird.4.0.44' to folder 'C:\dev\ServiceStack.Examples\src\ServiceStack.Northwind\packages'
Added package 'ServiceStack.OrmLite.Firebird.4.0.44' to 'packages.config'
Successfully installed 'ServiceStack.OrmLite.Firebird 4.0.44' to ServiceStack.Northwind
PM> 
È pubblicato 10/09/2015 alle 19:24
fonte dall'utente
In altre lingue...                            


1 risposte

voti
3

Non è possibile combinare diverse versioni delle librerie ServiceStack insieme. Questo errore suggerisce che sta ancora cercando di caricare più vecchio v4.0.11 di ServiceStack:

Messaggio = Metodo 'Esegui' nel tipo 'ServiceStack.Host.ServiceController' dall'assembly 'ServiceStack, Version = 4.0.11.0, Culture = neutral, PublicKeyToken = null' non ha un'implementazione.

Mi consiglia invece la clonazione del ServiceStackApps / Northwind repository che comprende solo un autonomo progetto Northwind copiare come-viene distribuito sul northwind.servicestack.net sito Demo Live e che fa riferimento già le ultime librerie v4.0.44 stabili che renderà più facile da modificare senza aggiornare qualsiasi pacchetto NuGet problemi.

Risposto il 10/09/2015 a 20:36
fonte dall'utente

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more