Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compilation netcoreapp1.0 with code which has Target Framework Monikers like #if !NETSTANDARD1_6

I have problem with my project's dependency which has Target Framework Monikers like:

#if !NETSTANDARD1_6

and when I compile for netcoreapp1.0 I have a compilation error, but netcoreapp1.0 support NETStandart1.6 , And I want to use this parts of the code in the app.

like image 923
Serhii Shemshur Avatar asked Jul 26 '16 08:07

Serhii Shemshur


1 Answers

When you compile for netcoreapp1.0, only the NETCOREAPP1_0 symbol will be defined by default.

This means that you have two options: Either add the NETSTANDARD1_6 define to netcoreapp1.0 in your project.json:

"frameworks": {
    "netcoreapp1.0": {
        "buildOptions": {
            "define": ["NETSTANDARD1_6"]
        }
    }
}

Or change your #if:

#if !NETSTANDARD1_6 && !NETCOREAPP1_0
like image 76
svick Avatar answered Sep 17 '22 20:09

svick