尝试使用asp.net vNext播放一些内容。
假设我已经MyCode.dll
汇编了一些代码,并且想要在be vNext项目中使用。如何引用现有的.net 4.5程序集?
我已经将其打包到nuget包中,然后使用本地供稿将其添加到vNext项目中。也用于kpm restore
实际下载软件包。
看起来软件包已成功添加,但是没有MyCode.dll
可用的代码,因此intelliSence和build throw根本不使用它Type or namespace chould not be found
我可以将代码从移动MyCode.dll
到asp.net 5类库,但是我需要重用其他项目也使用的现有dll,例如asp.net的旧版本等。
我的工作是添加一个本地nuget服务器,并正确地指定,打包程序集并将其推入nuget服务器,方法是可以将.NET的倍数版本定位为aspnetcore5,aspnet5和net45。创建程序集的规范文件时,请不要忘记为每个版本都包括它们的相应依赖项。
要创建本地服务器,请参见此处的说明
请参阅示例规范。
<dependencies>
<group targetFramework="net45">
<dependency id="Newtonsoft.Json" version="6.0.6" />
</group>
<group targetFramework="aspnet50">
<dependency id="Newtonsoft.Json" version="6.0.6" />
<dependency id="System" version="4.0.0.0" />
<dependency id="System.Core" version="4.0.0.0" />
<dependency id="Microsoft.CSharp" version="4.0.0.0" />
<dependency id="mscorlib" version="4.0.0.0" />
</group>
<group targetFramework="aspnetcore50">
<dependency id="Newtonsoft.Json" version="6.0.6" />
<dependency id="System.Runtime" version="4.0.20-beta-22231" />
<dependency id="System.Collections" version="4.0.10-beta-22516" />
</group>
</dependencies>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句