[英]Reference FrameworkAssembly in netcoreapp1.0
What is the prefered way to reference full framework assemblies like System.DirectoryServices.AccountManagement
on a netcoreapp that runs windows only? 在仅运行Windows的netcoreapp上引用完整框架程序集(如
System.DirectoryServices.AccountManagement
)的首选方法是什么?
The dnx supported this way: dnx支持这种方式:
"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: 并使用netcore将其更改为:
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
},
"frameworks": {
"netstandard1.5": {
"imports": "dnxcore50"
}
}
Using frameworkAssemblies
still works for me. 使用
frameworkAssemblies
仍然适合我。
If you want to use the assembly directly from your ASP.NET Core application, then the project.json would look like this: 如果要直接从ASP.NET Core应用程序使用程序集,那么project.json将如下所示:
"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 it indirectly through a class library, then the project.json in the class library would look like this: 如果你想通过类库间接进行,那么类库中的project.json将如下所示:
"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
): 在应用程序中(假设类库称为
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": {}
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.