如何手动将包添加到VS2017项目 [英] How to manually add a package to a VS2017 project

查看:803
本文介绍了如何手动将包添加到VS2017项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试手动将Nuget包安装到我的Visual Studio项目中。  (为什么是一个很长的故事)


我已将pakkages下载到我的机器缓存(程序文件(x86)\ microsoft sdks \\\
ugetpackages \)并手动输入以下内容我的.csproj文件中的行在Microsoft.AspNetCore.All条目下面:


    < PackageReference Include =" MySql.Data"版本= QUOT; 6.10.4" />
$
    < PackageReference Include =" MySql.Data.Entity"版本= QUOT; 6.10.4" />
$
    < PackageReference Include =" MySql.Data.EntityFrameworkCore"版本= QUOT; 6.10.4" />


当我打开项目时,包会显示感叹号。 我认为有一种方法可以恢复visual studio中的软件包,但是当我右键单击项目时,不会显示还原项目。


有人可以告诉我我缺少什么吗? / p>

解决方案

朋友,


请转到工具 - >选项 - > NuGet包管理器




提供名称和文件夹位置。单击确定。将您的nuget包文件放在该文件夹中。


转到您的项目,右键单击并选择"管理Nuget包"并选择新的包源。




如果有效,请告诉我。


 


祝你好运,


Fletcher






I'm trying to install a Nuget package to my Visual Studio project manually.  (why is a very long story)

I've downloaded the pakkages to my machine cache (program files (x86)\microsoft sdks\nugetpackages\) and manually entered the following lines in my .csproj file below the Microsoft.AspNetCore.All entry:

    <PackageReference Include="MySql.Data" Version="6.10.4" />
    <PackageReference Include="MySql.Data.Entity" Version="6.10.4" />
    <PackageReference Include="MySql.Data.EntityFrameworkCore" Version="6.10.4" />

When I open the project the packages show exclamation points.  I thought there was a way to restore the packages in visual studio, but no Restore item appears when I right-click on the items.

Can someone tell me what I'm missing?

解决方案

Hi friend,

Please go to Tools -> Options -> NuGet Package Manager :

Give a name and folder location. Click OK. Drop your nuget package files in that folder.

Go to your Project, Right click and select "Manage Nuget Packages" and select your new Package source.

Please let me know if it could work.

 

Best regards,

Fletcher


这篇关于如何手动将包添加到VS2017项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆