MySQL T4 Templates Error: Metadata file ‘MySql.Data’ could not be found

MySQLsubsonicsubsonic3t4vwdexpress

D:\Web\CityV2\App_Code\ActiveRecord.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'MySql.Data' could not be found

Let me start by saying I'm using VWD 2008 Express.

These are the steps I've taken so far:

  • Created an entirely new project
  • Added references for Subsonic.Core.dll and MySql.Data.dll
  • Copied Active Record templates to project
  • Changed all <#@ include file="SQLServer.ttinclude" #> to <#@ include file="MySQL.ttinclude" #>
  • Copied the MySQL.ttinclude and Settings.ttinclude from the TemplateProviders folder
  • Updated Settings.ttinclude with my connectionstring and database information
  • Updated the Settings.ttinclude and created the external tool mapping as per ranomore's instructions
  • Attempted to build the code from the templates and received the error

I then realized that I didn't have MySql Connector "installed" on my dev box (even though I added a reference to the bin). So I proceeded to MySQL.com and downloaded the latest 6.0.4 connector msi and installed it (GAC). The error no longer appears, but neither does anything else: no new classes, no new errors, nothing [and yes, I refreshed the project after running the command ;-)].

Two things:

  1. Am I missing a step somewhere?
  2. Is there a way build the templates without needing MySQL installed to the GAC?

Best Answer

Unfortunately SubSonic 3 doesn't support VWD 2008 Express (or more specifically VWD doesn't support t4). There is a sort of workaround that ranomore came up with but it will require some work by you. See the following question for more details:

SubSonic ASP.NET MVC sample in Visual Web Developer Express

EDIT: I should have read your question properly you obviously already have the link above. Maybe worth your while downloading the trial of VS professional and seeing if you have more luck with that to see if it's worth outlaying the cash to buy it. On a side note if you're looking to get an msdn subscription for free you should have a look into registering for the bizspark program