views:

138

answers:

2

E.g. when I add a new table it does not appear in the Northwind namespace untill I remove the project folder from : C:\Users\userName\AppData\Local\Temp\Temporary ASP.NET Files\

or add and readd the SubSonic.dll

I have the following configuration :

    <configSections>
      <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic"></section>

....

  <SubSonicService defaultProvider="Northwind">
    <providers>
      <clear/>
      <add name="Northwind" 
           type="SubSonic.SqlDataProvider, SubSonic" 
           connectionStringName="Northwind" 
           generatedNamespace="Northwind"/>
    </providers>
  </SubSonicService>

  <connectionStrings>
    <add name="Northwind" connectionString="Data Source=.;Database=Northwind;Integrated Security=true;"/>
  </connectionStrings>  

....
        <compilation debug="true">

          <buildProviders>
            <add extension=".abp" type="SubSonic.BuildProvider, SubSonic"/>

          </buildProviders>
...


      <pages>
        <controls>
        <add assembly="SubSonic" namespace="SubSonic" tagPrefix="subsonic"/>
+3  A: 

The issue here is that the BuildProvider doesn't "go off" unless you change the abp file in App_Code. It's a hack, but if you want it to work you need to open that file up and change it somehow by adding a space or something - then it will kick off the builder.

I'm working on some T4 templates so you don't have to do this. Also - you can use our commandline tool to generate the stuff to file for you: http://subsonicproject.com/subcommander/using-the-command-line-tool-subcommander/

Rob Conery
A: 

Thanks, both worked !

Either as you said to simply change the *.abp file ( added couple of spaces)

or

sonic.exe generate /config "D:\path\to\my\web.config"

P.S. I have a D:\temp\utils folder , where I keep all the command line tools used ... and it is part of the %PATH% environmental variable ... and it took me couple of minutes to realize that I had to copy the whole :

D:\libs\orm\SubSonic_2.1_Final_Source\src\SubSonic\bin\Debug directory to that command line tools folder ...

Edit: Even faster with VS External Tool command : Tools - External Tools - Add Title: SubSonic Command: D:\path\to\sonic.exe Arguments: generate /config "D:\path\to\my\web.config" Initial Directory: {$ProjectDir}

Tools - Options - Keyboard Find tools Subsonic

for it to work from anywhere on the command line

YordanGeorgiev