生成的本地Nuget软件包的问题 [英] Issue with local Nuget packages generated

查看:95
本文介绍了生成的本地Nuget软件包的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我遇到了与Nuget有关的问题,我在dotnet核心应用程序库中执行以下步骤:

I am facing an issue related to Nuget, where I am following below steps in dotnet core application library:

1.用"dotnet pack"生成Nuget包.在我计算机上的特定文件夹中.

1. Generating Nuget package with "dotnet pack" at a particular folder on my machine.

2.在管理Nugets"窗口(工具">选项">"Nuget软件包管理器")中添加了此文件夹位置.

2. Added this folder location in Manage Nugets window (Tools> options > Nuget Package Manager ).

3.在另一个项目中引用了Nuget.

3. Referenced the Nuget in one of another project.

现在,当该库有几个版本时,即使我更新了文件,Nuget仍将其弄乱并引用了以前的版本, 也清理了Nuget缓存,还尝试删除dll并替换它与最新的dll Nuget的解压缩文件夹,但无济于事.

 Now gradually when there are a few versions of the library then Nuget messes it up and refers to previous version even though I updated the file,  cleaned the Nuget cache as well, also tried deleting the dll and replacing it with latest dll in the unpacked folder of Nuget but nothing worked.

这是一个错误还是做错了?

Is this a bug or I am doing it wrong. 

谢谢


推荐答案

您好PrashantJaiswal,

Hi PrashantJaiswal,

>>>>现在,当有几个版本的库时,即使我更新了文件,Nuget仍将其弄乱并引用了以前的版本,并且也清理了Nuget缓存.尝试删除dll并将其替换为 Nuget的解压缩文件夹中的最新dll,但没有任何效果.

>>>Now gradually when there are a few versions of the library then Nuget messes it up and refers to previous version even though I updated the file,  cleaned the Nuget cache as well, also tried deleting the dll and replacing it with latest dll in the unpacked folder of Nuget but nothing worked.

在用解压缩后的文件夹中的最新dll替换dll并将其设置为计算机上的特定文件夹之后,是否重新打包了NuGet软件包?

Have you re-packed the NuGet package after you replace the dll with latest dll in the unpacked folder and set it to the particular folder on your machine?

如果是,我想为您提供有关此问题的疑难解答,如下所示:

If yes, I would like to provide you the troubleshootings for this issue as follows:

1.NuGet程序包的不同版本与不同的dll文件一起使用.如下面的示例所示,我们可以在两个或更多NuGet程序包中设置不同版本的dll文件.

1.Use the different versions of NuGet package with different dll file. As example below image, we could set different versions dll file in two or more NuGet packages.

通过使用不同的外部版本的NuGet包,可以更方便地引用不同的dll文件.

It`s more convenient to us to refer the different dll files by using different external version of NuGet packages。

2.Need 设置包含您要引用的dll的程序包.然后选择指定的软件包并安装/更新.

2.Need  set the package which including the dll that you want to refer to. Then select the specify package and install/update it.

3.在属性"窗口的项目引用"中检查引用路径,确保引用程序集路径正确.如果您的项目已经参考了以前的版本参考,则可以将其卸载并重新安装新的NuGet软件包 带有最新的dll文件.

3.Check the references path in project References from Properties window, make sure the references assemblies paths is correct. If you project is already referred to the previous version references, you can uninstall it and reinstall the new NuGet package with latest dll file.

如果没有,则需要将Nuget程序包与最新的dll重新打包,然后再将其引用到项目中.

If not, you need re-pack Nuget package with latest dll before you refer it to your project.

最好的问候,

Jack


这篇关于生成的本地Nuget软件包的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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