在ASP.NET Core项目模板中安装NuGet程序包 [英] Install NuGet package programmatic in ASP.NET Core project template

查看:131
本文介绍了在ASP.NET Core项目模板中安装NuGet程序包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VSIX扩展项目在Visual Studio 2017中为ASP.NET Core开发自定义项目模板。我使用IVSPackageInstaller使用以下默认函数将自定义第三方软件包安装到ASP.NET Core项目中。

I am developing the custom project template for the ASP.NET Core in Visual Studio 2017 by using VSIX extension project. I am using the IVSPackageInstaller to install the custom 3rd party packages into the ASP.NET Core project with the below default function.

InstallPackage(string source, Project project, string packageId, string version, bool ignoreDependencies);

在运行上述函数时,我遇到了以下错误。

While running the above function I have faced the below error.

1。我该如何解决这个问题?

1. How can I solve this problem?

2。请建议我在运行时将NuGet包安装到ASP.NET Core项目中的任何其他最简单的方法

2. Please suggest to me anyother simplest way to install the NuGet packages at runtime into the ASP.NET Core project

谢谢,

Ganesan R。

Ganesan R.

推荐答案

您好GaneshRengasamy,

Hi GaneshRengasamy,

>> 1。如何解决此问题?

请尝试以下解决方法:

Please try the following workaround:

打开VS2017(无加载您的解决方案),打开软件包管理器控制台,等待它完全加载,然后打开您的解决方案。

open VS2017 (without loading your solution), open the Package Manager Console, wait for it to fully load, then open your solution.

>>。请向我建议在运行时将NuGet包安装到ASP.NET Core项目中的任何其他最简单方法

您可以使用IVSPackageInstaller来安装自定义第三方软件包。

You could use  IVSPackageInstaller to install the custom 3rd party packages.

祝你好运,

Cole Wu


这篇关于在ASP.NET Core项目模板中安装NuGet程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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