Trying to follow the example in the blog post. Initially just tried to integrate the example code into a site I was building, finally gave up and tried the example verbatim (i.e. using "efcore" and cutting and pasting the code from the blog). Tried the latter on Ubuntu 16.04 that had .net core from release day, tried on Windows 10, also with .net core from release. Finally tried on a brand new 16.04 install on AWS.
In every case the build fails with the same error messages. This is from windows but I'm getting the same thing on linux:
Project efcore (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling efcore for .NETCoreApp,Version=v1.0
C:\Program Files\dotnet\dotnet.exe compile-csc @C:\Users\gerry\efcore\obj\Debug\netcoreapp1.0\dotnet-compile.rsp returned Exit Code 1
C:\Users\gerry\efcore\EmployeesContext.cs(46,10): error CS0246: The type or namespace name 'MaxLengthAttribute' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\gerry\efcore\EmployeesContext.cs(46,10): error CS0246: The type or namespace name 'MaxLength' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\gerry\efcore\EmployeesContext.cs(49,10): error CS0246: The type or namespace name 'MaxLengthAttribute' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\gerry\efcore\EmployeesContext.cs(49,10): error CS0246: The type or namespace name 'MaxLength' could not be found (are you missing a using directive or an assembly reference?)
Compilation failed.
0 Warning(s)
4 Error(s)
Time elapsed 00:00:00.7367607
If I comment out the two maxlength attributes then I get this error message instead:
C:\Users\gerry\efcore\EmployeesContext.cs(25,28): error CS1061: 'DbContextOptionsBuilder<EmployeesContext>' does not contain a definition for 'UseMySQL' and no extension method 'UseMySQL' accepting a first argument of type 'DbContextOptionsBuilder<EmployeesContext>' could be found (are you missing a using directive or an assembly reference?)
In every case the build fails with the same error messages. This is from windows but I'm getting the same thing on linux:
Project efcore (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling efcore for .NETCoreApp,Version=v1.0
C:\Program Files\dotnet\dotnet.exe compile-csc @C:\Users\gerry\efcore\obj\Debug\netcoreapp1.0\dotnet-compile.rsp returned Exit Code 1
C:\Users\gerry\efcore\EmployeesContext.cs(46,10): error CS0246: The type or namespace name 'MaxLengthAttribute' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\gerry\efcore\EmployeesContext.cs(46,10): error CS0246: The type or namespace name 'MaxLength' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\gerry\efcore\EmployeesContext.cs(49,10): error CS0246: The type or namespace name 'MaxLengthAttribute' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\gerry\efcore\EmployeesContext.cs(49,10): error CS0246: The type or namespace name 'MaxLength' could not be found (are you missing a using directive or an assembly reference?)
Compilation failed.
0 Warning(s)
4 Error(s)
Time elapsed 00:00:00.7367607
If I comment out the two maxlength attributes then I get this error message instead:
C:\Users\gerry\efcore\EmployeesContext.cs(25,28): error CS1061: 'DbContextOptionsBuilder<EmployeesContext>' does not contain a definition for 'UseMySQL' and no extension method 'UseMySQL' accepting a first argument of type 'DbContextOptionsBuilder<EmployeesContext>' could be found (are you missing a using directive or an assembly reference?)