Trying to create a portable library


#1

I’m currenty trying to convert the existing MySql.Data library to a portable version that compiles on all platforms. After dropping all incompatible code (e.g. transaction and configuration stuff) I managed to get it to compile in Visual Studio 2015. Now I’m trying to compile it using kpm but I get a lot of compilation errors. One example:

D:\Projecten\Dotnet\EntityFramework\src\MySql.Data.Portable\extensions\NonRT\MySqlCommand.cs(30,46): error CS0246: The type or namespace name ‘DbCommand’ could not be found (are you missing a using directive or an assembly reference?)

The output of the build process shows this output:

Building MySql.Data.Portable for .NETFramework,Version=v4.5.1
Using Project dependency MySql.Data.Portable 7.0.0
Source: D:\Projecten\Dotnet\EntityFramework\src\MySql.Data.Portable\project.json

Using Package dependency System.Data.Common 4.0.0-beta-22526
Source: C:\Users\Bart.k\packages\System.Data.Common\4.0.0-beta-22526
File: lib\net45\System.Data.Common.dll

Why am I getting this error ?

This is my project.json:

{
“version”: “7.0.0-*”,
“description”: “MySql Provider”,
“compilationOptions”: {
“warningsAsErrors”: false
},
“dependencies”: {
“System.Data.Common”: “1.0.0-beta2”,
“System.Security.Cryptography.Encoding”: “4.0.0-beta-22625”,
“System.Security.Cryptography.Encryption”: “4.0.0-beta-22625”,
“System.Security.Cryptography.Hashing”: “4.0.0-beta-22625”,
“System.Security.Cryptography.Hashing.Algorithms”: “4.0.0-beta-22625”,
“System.Security.Cryptography.X509Certificates”: “4.0.0-beta-22625”

},
"frameworks": {
    "net451": { },
    "aspnet50": {
        "dependencies": {
            "Microsoft.Framework.Runtime.Interfaces": { "version": "1.0.0-*", "type": "build" }
        }
    },
    "aspnetcore50": {
        "dependencies": {
            "Microsoft.Framework.Runtime.Interfaces": { "version": "1.0.0-*", "type": "build" },
            "System.IO.FileSystem": "4.0.0-beta-*",
            "System.Runtime.InteropServices": "4.0.20-beta-*"
        }
    },
    ".NETPortable,Version=4.6,Profile=Profile157": {
        "frameworkAssemblies": {
            "mscorlib": "",
            "System.Collections": "",
            "System.ComponentModel": "",
            "System.Diagnostics.Debug": "",
            "System.Globalization": "",
            "System.IO": "",
            "System.Linq": "",
            "System.Reflection": "",
            "System.Reflection.Primitives": "",
            "System.Resources.ResourceManager": "",
            "System.Runtime": "",
            "System.Runtime.Extensions": "",
            "System.Runtime.InteropServices": "",
            "System.Security.Principal": "",
            "System.Text.Encoding": "",
            "System.Threading.Tasks": ""
        }
    }
}

}


#2

“System.Data.Common”: “1.0.0-beta2”,

This needs to be 4.0.0-beta-* I think, see http://www.nuget.org/packages/System.Data.Common/4.0.0-beta-22605


.NET Foundation Website | Blog | Projects | Code of Conduct