I added Nuget packages System.Data.SQLite and Linq2DB.SQLite to my project and I can compile and run a simple console application executing some test sql on a sqlite3 db file without any problems.
However, when I try to use the T4 template to generate the .cs code for my tables, I get an error
Running transformation: System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
from the DataModel.ttinclude file.
The x64/x86 folders with the relative SQLite.Interop.dll files were properly generated under the debug folder after building the project.
This is my very easy .tt file
<#@ template language="C#" debug="True" hostSpecific="True" #>
<#@ output extension=".generated.cs" #>
<#@ include file="$(LinqToDBT4SQLiteTemplatesPath)LinqToDB.SQLite.Tools.ttinclude" once="true" #>
<#@ include file="$(LinqToDBT4SQLiteTemplatesPath)PluralizationService.ttinclude" once="true" #>
<#
NamespaceName = "DataModel";
LoadSQLiteMetadata(@"C:\DB", "Test.db");
GenerateModel();
#>
I tried to add all the possible assembly directives to both my .tt and the DataModel.ttinclude file, with no luck.
User contributions licensed under CC BY-SA 3.0