title: InvalidCastException when trying to generate code via Subsonic with a vb.net web site
body: <p>I'm trying to use Subsonic 3.0.0.3 with an existing web site created in vb.net. I've added a reference to SubSonic.Core.dll and added the ActiveRecord tt/ttinclude files. I also added a contextmenu entry to run the t4 templates using instructions I found <a href="http://biasecurities.com/blog/2008/visual-studio-website-project-add-context-menu-for-t4-files/" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Whenever I try to run any of the tt files, I receive the following exception. Does this have something to do with me using a web site as opposed to a web application?</p>
  
  <pre>f:\Documents and Settings\dbollard\Local Settings\Temp\SQLServer.ttinclude(85,15) : warning CS0219: Compiling transformation: The variable 'parameters' is assigned but its value is never used
  ActiveRecord.tt(0,0) : error : Running transformation: System.InvalidCastException: Unable to cast object of type 'Microsoft.VisualStudio.TextTemplating.CommandLine.CommandLineHost' to type 'System.IServiceProvider'.
     at Microsoft.VisualStudio.TextTemplating0b65ddb399f24da48b32cd0d1253af37.GeneratedTextTransformation.GetCurrentProject() in f:\Documents and Settings\dbollard\Local Settings\Temp\Settings.ttinclude:line 103
     at Microsoft.VisualStudio.TextTemplating0b65ddb399f24da48b32cd0d1253af37.GeneratedTextTransformation.GetConnectionString(String connectionStringName) in f:\Documents and Settings\dbollard\Local Settings\Temp\Settings.ttinclude:line 51
     at Microsoft.VisualStudio.TextTemplating0b65ddb399f24da48b32cd0d1253af37.GeneratedTextTransformation.get_ConnectionString() in f:\Documents and Settings\dbollard\Local Settings\Temp\Settings.ttinclude:line 87
     at Microsoft.VisualStudio.TextTemplating0b65ddb399f24da48b32cd0d1253af37.GeneratedTextTransformation.GetReader(String sql) in f:\Documents and Settings\dbollard\Local Settings\Temp\SQLServer.ttinclude:line 5
     at Microsoft.VisualStudio.TextTemplating0b65ddb399f24da48b32cd0d1253af37.GeneratedTextTransformation.LoadTables() in f:\Documents and Settings\dbollard\Local Settings\Temp\SQLServer.ttinclude:line 115
     at Microsoft.VisualStudio.TextTemplating0b65ddb399f24da48b32cd0d1253af37.GeneratedTextTransformation.TransformText() in f:\Documents and Settings\dbollard\Local Settings\Temp\ActiveRecord.tt:line 21</pre>