question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UseMySQL extension method is missing in DbContextOptionsBuilder

See original GitHub issue

Steps to reproduce

In ConfigureServices when I try following:

 // Add database Context
            services.AddDbContext<ApplicationDbContext>(options =>
            {
                options.UseMySQL(Configuration.Get<AppOptions>().ConnectionStrings.MySqlProvider);
                options.UseOpenIddict();
            });

It doesn’t work. Due to DateTimeOffset issue in Sapient I am moving to Pomelo, but UseMySQL extension method is missing. In Sapient using MySQL.Data.Entity.Extensions; provided the needed extension.

The issue

UseMySQL extension method is missing.

Exception message:
error CS1061: 'DbContextOptionsBuilder' does not contain a definition for 'UseMySQL' and no extension method 'UseMy
SQL' accepting a first argument of type 'DbContextOptionsBuilder' could be found (are you missing a using directive or an assembly ref
erence?)

Further technical details

MySQL version: 5.7.17 Operating system: macOS Pomelo.EntityFrameworkCore.MySql version: 1.1.1

Other details about my project setup:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
caleblloydcommented, Mar 26, 2017

It’s case-sensitive, UseMySql

Here’s an example

4reactions
caleblloydcommented, Mar 26, 2017

You must import:

using Microsoft.EntityFrameworkCore;
Read more comments on GitHub >

github_iconTop Results From Across the Web

'DbContextOptionsBuilder' does not contain a definition for ...
Error CS1061 'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer' and no extension method 'UseSqlServer' accepting a first ...
Read more >
How to solve 'DbContextOptionsBuilder' does not contain a ...
An easy fix for CS1061'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer' and no accessible extension method ...
Read more >
Fix : DbContextOptionsBuilder does not contain a definition for ...
Fix : cs1061 DbContextOptionsBuilder does not contain a definition for UseSqlServer and no accessible extension method UseSqlServer ...
Read more >
'DbContextOptionsBuilder' does not contain a definition for ...
The method ReadAsAsync is an extension method declared in the class HttpContentExtensions , which is in the namespace System.Net.Http in the library System.Net....
Read more >
Can't build EntityFrameworkCore example
Trying to follow the example in the blog post. Initially just tried to integrate the example code into a site I was building,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found