简体   繁体   English

如何在 .nuspec 文件中包含来自自定义提要的引用?

[英]How to include references from a custom feed in a .nuspec file?

I have a C# library published at nuget.org .我有一个在 nuget.org 上发布的nuget.org库。 One of its dependencies is not on nuget.org , but on myget.org .它的依赖项之一不在nuget.org上,而是在myget.org上。 When others try to use my library, package restore fails with the following message:当其他人尝试使用我的库时,package 还原失败并显示以下消息:

Error   NU1102  Unable to find package SixLabors.ImageSharp.Drawing with version (>= 1.0.0-unstable0418)
  - Found 7 version(s) in nuget.org [ Nearest version: 1.0.0-beta0007 ]
  - Found 0 version(s) in Microsoft Visual Studio Offline Packages          

How can I specify in the .nuspec file, that this dependency should be restored from a different repo (I'd prefer this solution)?如何在.nuspec文件中指定应该从不同的 repo 恢复此依赖项(我更喜欢此解决方案)? Or alternatively how do I include this package in my package as a dependency?或者,我如何将这个 package 作为依赖项包含在我的 package 中?

Looks like this is by design with few alternatives mentioned in the following docs https://github.com/NuGet/Home/issues/6008看起来这是设计使然,以下文档https://github.com/NuGet/Home/issues/6008中提到了一些替代方案

https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1102 https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1102

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NuGet - NU5131:在 nuspec 文件中声明的引用没有被打包 - NuGet - NU5131: References declared in the nuspec file are not being packaged 如何使用msbuild 15从生成的nuget包中的nuspec文件中删除依赖项部分 - How to remove the dependencies section from nuspec file in the generated nuget package using msbuild 15 如何在没有任何nuspec文件的情况下将多个项目中的产品打包到一个nuget中? - How to pack the products from multiple projects into one nuget without any nuspec file? 通过my_file.nuspec将文件从文件夹复制到其他文件夹 - Copy file from folder to other folder by my_file.nuspec 如何在生成的 .nuspec 的 MSBuild NuGet 包中注入自定义依赖项 - How to inject a custom dependency in an MSBuild NuGet pack generated .nuspec 如何在nuspec文件中添加发行说明文件路径参考 - How to add Release Notes file path reference in nuspec file 生成解决方案的nuspec文件? - generate nuspec file for solution? Nuke 和更新 nuspec 文件 - Nuke and update nuspec file 如何仅在 .nuspec 文件中标记运行时的依赖项? - How can I mark dependencies for runtime only in a .nuspec file? 如何在官方nuget服务器上访问nuget包的nuspec文件? - How to get access to nuspec file of a nuget package on official nuget server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM