tags:

views:

155

answers:

1

All the sudden I cannot get Subsonic to generate new class files off my database, and I can't find anyone with the same problem. Take a look at the Command, Web.Config and Output Error below to see if you can help. Thanks.

Command

C:\Documents and Settings\My Documents\SubSonic2.2_2\SubSonic2.2\SubCommander\sonic.exe generate /out DAL/generated


Web.Config

<connectionStrings>
  <add name="Methodagile" connectionString="Data Source=64.50.163.75;Database=kimbe16_zany;Uid=kimbe16_zany;Pwd=password;Min Pool Size=25;Max Pool Size=150;"/>
</connectionStrings>
<SubSonicService defaultProvider="Methodagile">
  <providers>
    <clear />
    <add name="Methodagile" type="SubSonic.MySqlDataProvider, SubSonic" connectionStringName="Methodagile" generatedNamespace="Methodagile" />
  </providers>
</SubSonicService>


Output Error

Setting ConfigPath: 'Web.config'
Building configuration from C:\Documents and Settings\newproject.com\Web.config
Adding connection to MySqlDatabase
Generating classes for MySqlDatabase (5 total)
Finished
Setting ConfigPath: 'Web.config'
Building configuration from C:\Documents and Settings\newproject.com\Web.config
Adding connection to MySqlDatabase
Generating ODS Controllers for MySqlDatabase (5 total)
Finished
Setting ConfigPath: 'Web.config'
Building configuration from C:\Documents and Settings\newproject.com\Web.config
Adding connection to MySqlDatabase
ERROR: Trying to execute generate
Error Message: System.NullReferenceException: Object reference not set to an instance of an object.
at SubSonic.SubCommander.Program.GenerateViews() in D:\@SubSonic\SubSonic\SubCommander\Program.cs:line 1067
at SubSonic.SubCommander.Program.GenerateAll() in D:\@SubSonic\SubSonic\SubCommander\Program.cs:line 790
at SubSonic.SubCommander.Program.Main(String[] args) in D:\@SubSonic\SubSonic\SubCommander\Program.cs:line 90
Execution Time: 23552ms

A: 

Yeah I'm having the same issue. I created a table today, ran structs.tt and activerecord.tt VS2010 picks up that the columns are now properties. But when I try to assign a value to a property it tries to find the column but can't.

tbl.Columns.SingleOrDefault(x => x.Name == "MyColumnsName") returns null.

Sean