【ASP.NET】利用Nuget打包package——GUI方式
GUI方式
通过GUI的方式,可以下载如下的软件
打包dll
1.打开软件,在Package Content处点击右键 ,选择Add Lib
![](https://images2015.cnblogs.com/blog/250006/201608/250006-20160813193143093-56139155.png)
2.在lib处,点击添加Add .NET folder
![](https://images2015.cnblogs.com/blog/250006/201608/250006-20160813193150531-503011493.png)
3.向文件夹中添加dll文件
![](https://images2015.cnblogs.com/blog/250006/201608/250006-20160813193202250-1522725547.png)
在file菜单处选择Edit Metadata,对package的描述文件进行编辑
<?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>StoShared.NHibernate</id> <version>1.1.0.357</version> <title>STO Shared nHibernate Library</title> <authors>Microsoft Corporation</authors> <owners>Microsoft Corporation</owners> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description>nHibernate libraries shared across Server and Tools Online</description> <copyright>Copyright (c) Microsoft Corporation 2013</copyright> <dependencies> <dependency id="log4net" version="2.0.0" /> <dependency id="NHibernate" version="3.3.1.4000" /> <dependency id="structuremap" version="2.6.4.1" /> </dependencies> </metadata> </package>
编辑完成后,在菜单选择file-save as进行保存即可。
![](https://images2015.cnblogs.com/blog/250006/201608/250006-20160813193216421-317025398.png)
使用的时候,把package放在nuget服务器上,并在Nuget.config中设置源即可
<configuration> <activePackageSource> <add key="Framework" value="\\epxsource\builds\Nuget\MSDN.Framework" /> <add key="Package source" value="\\epxsource\Builds\Nuget" /> <add key="nuget.org" value="https://www.nuget.org/api/v2/" /> </activePackageSource> <config> <add key="repositoryPath" value="..\packages" /> </config> <solution> <add key="disableSourceControlIntegration" value="true" /> </solution> <packageSources> <add key="Framework" value="\\epxsource\builds\Nuget\MSDN.Framework" /> <add key="Package source" value="\\epxsource\Builds\Nuget" /> <add key="nuget.org" value="https://www.nuget.org/api/v2/" /> </packageSources> </configuration>
![](https://images2015.cnblogs.com/blog/250006/201608/250006-20160813193234296-835155737.png)
最新博客地址:http://blog.turenlong.com/