samedi 31 janvier 2015

SQLite as an Elmah source

I'm trying to get SQLite working with Elmah, but it keeps complaining about the attached version.


I've read numerous blogs on the topic but none of the recommended approaches has worked for me thus far.


Elmah.MVC has been installed, as the latest version found in NUGET, then installed the SQLite core framework has been attached, as per the current version in NUGET as well.


From what I can gather, it's in the way that NUGET appends the SQLite entries into the web.config file, but I cannot see a difference.


My packages.config (entries left out for readability):



<?xml version="1.0" encoding="utf-8"?>
<packages>
.....
<package id="elmah.corelibrary" version="1.2.1" targetFramework="net45" />
<package id="Elmah.MVC" version="2.1.1" targetFramework="net45" />
<package id="System.Data.SQLite" version="1.0.94.1" targetFramework="net45" />
<package id="System.Data.SQLite.Core" version="1.0.94.0" targetFramework="net45" />
<package id="System.Data.SQLite.EF6" version="1.0.94.0" targetFramework="net45" />
<package id="System.Data.SQLite.Linq" version="1.0.94.1" targetFramework="net45" />
.....
</packages>


Elmah has been implemented as a View / Controller rather than the standard .axd version that comes predefined, so when I browse http://localhost:3812/Elmah/ the following stack trace gets thrown:



Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


And Pre-bind state information



=== Pre-bind state information ===
LOG: DisplayName = System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
(Fully-specified)
LOG: Appbase = file:///C:/Users/Admin/Documents/Visual Studio 2015/Projects/TestMvc/Site/TestMvc.WebSite/
LOG: Initial PrivatePath = C:\Users\Admin\Documents\Visual Studio 2015\Projects\TestMvc\Site\TestMvc.WebSite\bin
Calling assembly : Elmah, Version=1.2.14318.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Admin\Documents\Visual Studio 2015\Projects\TestMvc\Site\TestMvc\web.config
LOG: Using host configuration file: C:\Users\Admin\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
LOG: Attempting download of new URL file:///C:/Users/Admin/AppData/Local/Temp/Temporary ASP.NET Files/root/65395abf/3be698df/System.Data.SQLite.DLL.
LOG: Attempting download of new URL file:///C:/Users/Admin/AppData/Local/Temp/Temporary ASP.NET Files/root/65395abf/3be698df/System.Data.SQLite/System.Data.SQLite.DLL.
LOG: Attempting download of new URL file:///C:/Users/Admin/Documents/Visual Studio 2015/Projects/TestMvc\Site\TestMvc/bin/System.Data.SQLite.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


I do not believe this to be an issue with Visual Studio 2015 CTP, nor with the latest version of the both Elmah.MVC or SQLite or the build attributes (Any CPU vs x86/x64) as SQLite works fine when doing basic CRUD against the database (not shown in this question).


Any assistance would be greatly appreciated.


Aucun commentaire:

Enregistrer un commentaire