Jump to content

Modifying WRobot Config


Recommended Posts

I am using Entity Framework in my project which requires additions to the app.config: 

							<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
							<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
							  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
							  <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
							<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
								<parameter value="mssqllocaldb" />

However, if I modify WRobot.exe.config the application will not start. 


Link to comment
Share on other sites

I figured it out, I programatically registered the types


 public class WoWClassDbConfig : DbConfiguration
    {public WoWClassDbConfig()
            // Register Entity Framework provider
            SetProviderServices("MySql.Data.MySqlClient", new MySqlProviderServices());
            SetDefaultConnectionFactory(new MySqlConnectionFactory());


        public void SetupConnection(string username, string password, string server)
            var entityConnectionStringBuilder = new EntityConnectionStringBuilder
                Provider = "MySql.Data.MySqlClient",
                ProviderConnectionString =
                    $"server={server};user id={username};password={password};persistsecurityinfo=True;database=wowdb;ConvertZeroDateTime=true;SslMode=none",
                Metadata = "WoWClassicDb.csdl|WoWClassicDb.ssdl|WoWClassicDb.msl"
            entityConnectionStringBuilder.ProviderConnectionString += ";pooling=false";

            ConnectionString = entityConnectionStringBuilder.ToString();

        public string ConnectionString { get; set; }

    public partial class WoWClassicDb : DbContext
        public WoWClassicDb(string connectionString)
            : base(connectionString)



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...