Reference structure Assembly in netcoreapp1.0

What is the preferred way of referencing complete assembly assemblies, such as System.DirectoryServices.AccountManagementnetcoreapp, which only runs windows?

dnx is supported as follows:

 "frameworks": {
    "dnx451": {
      "frameworkAssemblies": {
        "System.DirectoryServices.AccountManagement": "4.0.0.0",
        "System.Messaging": "4.0.0.0",
        "System.Runtime.Serialization": "4.0.0.0"
      }
    }
  },

and with netcore it changed to:

 "dependencies": {
    "NETStandard.Library": "1.5.0-rc2-24027"
  },

  "frameworks": {
    "netstandard1.5": {
      "imports": "dnxcore50"
    }
  }
+4
source share
1 answer

Usage frameworkAssembliesstill works for me.

If you want to use the assembly directly from your ASP.NET Core application, then project.json will look like this:

"dependencies": {
  "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
  "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final"
},

"frameworks": {
  "net461": {
    "frameworkAssemblies": {
      "System.DirectoryServices.AccountManagement": "4.0.0.0"
    }
  }
},

If you want to do this indirectly through the class library, then project.json in the class library will look like this:

"dependencies": {
  "NETStandard.Library": "1.5.0-rc2-24027"
},

"frameworks": {
  "net461": {
    "frameworkAssemblies": {
      "System.DirectoryServices.AccountManagement": "4.0.0.0"
    }
  }
}

And in the application (assuming the class library is called ClassLibrary):

"dependencies": {
  "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
  "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
  "ClassLibrary": "1.0.0-*"
},

"frameworks": {
  "net461": {}
},
+3

All Articles