Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:58:08+00:00 2026-06-11T15:58:08+00:00

I use visual studio 2010 and tried to use subsonic and i am getting

  • 0

I use visual studio 2010 and tried to use subsonic and i am getting the following error.

Error 2 Compiling transformation: Metadata file ‘MySql.Data’ could not be found D:\TradingTools\CODE\ConsoleApplication8\subsoniccomponents\Structs.tt 1 1 backtester

As you can see from the screenshot, i do have mysql.data in my references. i dunno how to fix this. Can you help fixing this problem.
http://postimage.org/image/s1es0mr79/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:58:09+00:00Added an answer on June 11, 2026 at 3:58 pm

    SubSonic uses the DbProviderFactory pattern.
    The DbProviderFactory approach allows the creation of Connections/Commands/… without knowning the concrete type.

    // without factory
    var con = new MySqlConnection();
    var cmd = new MySqlCommand();
    
    // with factory
    var factory = DbProviderFactories.GetFactory("MySql.Data.MySqlClient");
    var con = factory.CreateConnection();
    var cmd = factory.CreateCommand();
    

    which is a way more generic approach.

    However, in order for this to work, you have to install MySql.Data (the msi-Package) which makes some entries in the machine.config file.

    That said,

    I also prefer my build environment not to rely on installed software, which makes it a lot easier to switch to a new machine without installing multiple dependencies.

    But this requires a little bit work:

    Modify your app.config/web.config file and place this somewhere between <configuration> and </configuration>

      <system.data>
        <DbProviderFactories>
          <remove invariant="MySql.Data.MySqlClient"/>
          <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
           description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.4.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
        </DbProviderFactories>
      </system.data>
    

    I just copied and pasted the snippet from

    %windir%\Microsoft.NET\Framework\<version>\Config
    

    after installing the MSI.

    If your solution has multiple projects, you have to do this for the main project (so subsonic can find your provider at runtime) and in your DAL project (so subsonic can find your provider during code generation).

    If you use another MySQL Version you can change that.

    The second thing you have to do is to tell the templates where to find the MySql.Data.dll (if it is not in the GAC).

    You can do this by editing the MySQL.ttinclude file (look at the assembly directive)

    <#@ include file="Settings.ttinclude" #>
    <#@ assembly name="$(SolutionDir)\Dependencies\MySql.Data.dll" #>
    <#@ import namespace="MySql.Data.MySqlClient" #>
    <#+
    

    With these changes my solution runs find and template generation also works find on a clean install without any MySql Components installed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this linker error when compiling wxWidgets in Visual Studio 2010. msvcrt.lib(wcrtexew.obj) :
I'm trying to use visual studio 2010. But it seems that the .sln file
I use CMake to generate a Visual Studio 2010 project and solution file. Actually
I am currently using TFS with Visual Studio 2010 Ultimate and getting this error
Does anyone know if it is possible to use Visual Studio 2010 RC with
How to export use case diagram in visual studio 2010 as image? jpg or
I am trying to use the peek function in Visual Studio 2010 with these
I'm trying to use LINQ to SQL Server in C#/.NET on Visual Studio 2010.
I Use Visual Studio 2010 with ASP.NET 4.0 and IIS7. When I open my
I am trying to extend Visual Studio 2010 RC to be able to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.