每次我打开代码时,newtonsoft json软件包都需要重新安装 [英] newtonsoft json package requires reinstall every time i open code

查看:183
本文介绍了每次我打开代码时,newtonsoft json软件包都需要重新安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在SSIS的脚本任务中编写C#代码.我需要在代码中使用Newtonsoft JSON包,因此我已经从NuGet安装了它.第一次安装时,它工作正常,但是当我关闭代码并重新打开以进行更改时,我必须按照update-package -Reinstall重新安装软件包. .com/questions/40709733> Visual Studio应用程序中的解决方案中缺少某些NuGet程序包.

I'm writing C# code in a script task in SSIS. I need to use the Newtonsoft JSON package in the code so i have installed it from NuGet. When it is first installed it works fine, but when I close my code and re-open it to make a change, I have to re-install the package using update-package -Reinstall as per the Some NuGet packages are missing from the solution in Visual Studio Application post.

为什么每次都必须这样做?我在做错什么吗?

Why do I have to do this every time? Am I doing something wrong?

感谢您的帮助.

推荐答案

我发现手动将程序集添加到GAC可以为我解决此问题.为此:

I found that adding the assembly to the GAC manually fixed the issue for me. To do this:

  1. 在管理员模式下打开"VS开发人员命令提示符(SSDT)".
  2. 运行此命令:gacutil -i程序集名称"

对于程序集名称,我只需要浏览本地驱动器以获取要添加的DLL的副本,然后在程序集名称"中使用完整的文件路径(C:... Newtonsoft.json.dll)

For the assembly name, I just needed to browse my local drive for a copy of the DLL i was adding and then use the full file path (C:...Newtonsoft.json.dll) in the "assembly name".

https://docs .microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs

这篇关于每次我打开代码时,newtonsoft json软件包都需要重新安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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