我正在构建一个引用Microsoft CommonServiceLocator程序集的NuGet包.
那里有两个版本的Microsoft CommonServiceLocator:
我的项目是一个可移植类库,但由于它有时与Enterprise Library一起使用,我需要对"可移植版本"进行"有条件"引用,这样就没有冲突了.
我在NuGet文档中看到了新的"组"功能,显示了如何在.nuspec文件中指定依赖项,我认为这将完成我想要的,但我不确定如何测试它.
这是我认为我需要做的事情,我希望有人可以验证我的方法或指出我正确的方向:
<dependencies>
<group>
<!-- Always include regardless of target framework -->
<dependency id="Autofac" />
</group>
<group targetFramework="net40">
<!-- Also include the full CSL if it's full framework -->
<dependency id="CommonServiceLocator" />
</group>
<group targetFramework="portable-win+sl50+wp8">
<!-- Otherwise include the Portable CSL -->
<dependency id="Portable.CommonServiceLocator" />
</group>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
特别...
targetFramework
语法合适吗?我找不到任何示例,所以我不知道+
分隔机制是否正确或是否应该以逗号分隔.是的,这非常正确.有关可移植框架名称的详细信息,请访问http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Framework_Names
我发现还有一件事,因为win + sl50 + wp8默认包含net45,你可能想要包含它以便安装这个依赖组.
归档时间: |
|
查看次数: |
5775 次 |
最近记录: |