Denis
Denis

Reputation: 923

OrmLite - does not generate poco files

I am new to T4. I need to generate default sheema for my db by using ServiceStack.OrmLite.T4. I installed Install-Package ServiceStack.OrmLite.T4 and added app.config to my project.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <system.data>
    <DbProviderFactories>
      <add name="SqlClient Data Provider" 
         invariant="System.Data.SqlClient" 
         description=".Net Framework Data Provider for SqlServer" 
         type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    </DbProviderFactories>
  </system.data>
  <connectionStrings>
    <add name="Default" 
       connectionString="Data Source=(local)\SQLEXPRESS;Integrated Security=True;Initial Catalog=TestDb;" 
       providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

Then I rebuild the project and nothing happens. Why the cs files would not created?

Upvotes: 0

Views: 504

Answers (1)

Matt Ward
Matt Ward

Reputation: 47937

The T4 templates will not be processed on each build unless you explicitly configure it to do so.

Normally you have to save the T4 file in Visual Studio or run the templating tool by right clicking the file in the Solution Explorer and selecting Run Custom Tool.

Upvotes: 1

Related Questions