Namespace error name 'Linqtodb' could not be found

Asked

Viewed 118 times

1

I downloaded Linq2db.Firebird via Nuget and changed the file as per the tutorial:

<#@ template language="C#" debug="True" hostSpecific="True"                          #>
<#@ output extension=".generated.cs"                                                 #>
<#@ include file="$(ProjectDir)LinqToDB.Templates\LinqToDB.Firebird.ttinclude"       #>
<#@ include file="$(ProjectDir)LinqToDB.Templates\PluralizationService.ttinclude"    #>
<#
    /*
        1. Copy this file to a folder where you would like to generate your data model,
           rename it, and delete .txt extension. For example:

            MyProject
                DataModels
                    MyDatabase.tt

        2. Modify the connection settings below to connect to your database.

        3. Add connection string to the web/app.config file:

            <connectionStrings>
                <add name="dados" connectionString="DataSource=localhost;Database=E:\OneDrive\VisualStudio\BancoFirebird\BancoFirebird\DADOS.GDB;User Id=SYSDBA;Password=masterkey" providerName="Firebird" />
            </connectionStrings>

        4. To access your database use the following code:

            using (var db = new MyDatabaseDB())
            {
                var q =
                    from c in db.Customers
                    select c;

                foreach (var c in q)
                    Console.WriteLine(c.ContactName);
            }

        5. See more at https://github.com/linq2db/t4models/blob/master/Templates/ReadMe.LinqToDB.md.
    */

    NamespaceName = "DataModels";

    LoadFirebirdMetadata("localhost", @"E:\OneDrive\VisualStudio\BancoFirebird\BancoFirebird\DADOS.GDB");
//  LoadFirebirdMetadata(string server, string database, string uid, string password);
//  LoadFirebirdMetadata(string connectionString);

    GenerateModel();
#>

I did steps one through three:

  1. I copied the file to a folder called Datamodels and renamed it to data.tt
  2. I changed the configuration, as you can see in the file:

    Loadfirebirdmetadata("localhost", @"E: Onedrive Visualstudio Bancofirebird Bancofirebird DADOS.GDB");

  3. I changed the Connection string, as you can also see in the file above and included in the app.config.

however, I keep getting the error:

Compiling transformation: The type or namespace name 'LinqToDB' could not be found (are you missing a using directive or an assembly reference?)    BancoFirebird

On this line: <#@include file="$(ProjectDir)LinqToDB.Templates\LinqToDB.Firebird.ttinclude" #>

Since I’ve been in the folder and I saw that the file is there.

What I must do?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.