嵌入到 NuGet 包中的图标不会出现在 VS 中 [英] Embedded into NuGet package icon doesn't appear in VS

查看:55
本文介绍了嵌入到 NuGet 包中的图标不会出现在 VS 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的 nuspec 文件生成了一个 nuget 包:

<file src="lib\net48\Common*.dll" target="lib/net48"/><file src="Licenses\License.txt" target="Licenses\"/><file src="Icons\Icon.PNG" target="Icons\"/></文件></包>

打包源数据的文件夹结构如下:

RootDir图标图标.png库网48驱动程序Common1.dllCommon2.dlldll文件执照许可证.txt我的.nuspec

我成功生成了它.但是,无论是在本地托管还是在 Azure Artifacts 作为私有源托管它,然后当我在 VS2017(这是我目前安装的)中浏览以安装项目时,生成的包都不会显示其嵌入的图标,而是显示默认的 nuget 包图标.我尝试从我的本地提要或从 Azure 私人提要浏览,同样的事情.没有使用我嵌入的 nuget 包图标的原因是什么?

解决方案

嵌入到 NuGet 中的包图标不会出现在 VS 中

实际上,这是 nuget 的一个众所周知的问题,对于创建我们自己的 nuget 提要、包源或本地地址,nuget 图标无法显示在包管理 UI 中.请参阅此

nuget.org 网站:

此外,您可以在我们的用户语音论坛中建议此功能反映你的想法

I generate a nuget package using my nuspec file below:

<?xml version="1.0" encoding="utf-8"?>
<package >
  <metadata>
    <id>CommonLib</id>
    <version>1.2.3</version>
    <authors>ABC</authors>
    <owners>ULC</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <license type="file">Licenses\License.txt</license>
    <icon>Icons\Icon.PNG</icon>
    <description>Common References</description>
    <copyright>Copyright (c) 2020</copyright>
    <tags>Common</tags>

      <dependencies>
          <group targetFramework="net48" />
      </dependencies>
  </metadata>

  <files>
      <file src="lib\net48\Common*.dll" target="lib/net48" />
      <file src="Licenses\License.txt" target="Licenses\" />
      <file src="Icons\Icon.PNG" target="Icons\" />
  </files>
</package>

The folder structure for the source data for packing is as the following:

RootDir
    Icons
        Icon.png
    lib
        net48
            Abc.dll
            Common1.dll
            Common2.dll
            xyz.dll
    Licenses
        License.txt
    My.nuspec

I successfully generate it. However, whether I host it locally or in my Azure Artifacts as private feed, then when I browse in VS2017 (that's what I currently have installed) to install for a project then the generated package doesn't show its embedded icon, instead, it shows the default nuget pack icon. I tried browsing either from my local feed or from Azure private feed, same thing. What's the reason my embedded into nuget pack icon is not being used?

解决方案

Embedded into NuGet package icon doesn't appear in VS

Actually, this is a well-known issue for nuget and for creating our own nuget feed, package source, or local address, the nuget icon cannot be displayed in the package manage UI. See this similar issue.

So if you add comments in this github link to get the staff's attention so that they can focus on the issue and fix it.

In your situation, you use private local nuget feed to install such nuget package and it cannot be realized and the latest version nuget.exe v5.5.1 does not support this so far.

Solution

Please upload your nuget package into nuget.org website an then use nuget.org nuget feed to install your nuget package.

And nuget.org supports the sustom icon to show your nuget package.

And then you can directly use nuget.org to install your own nuget package.

l have test it:

local feed:

nuget.org website:

Besides, you could suggest this feature in Our User Voice Forum to reflect your thoughts

这篇关于嵌入到 NuGet 包中的图标不会出现在 VS 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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