Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When targetting .NET 9 and .NET Framework 4.8.1, NuGet throws: NU5046: The icon file 'favicon256.png' does not exist in the package. #13936

Open
SetTrend opened this issue Nov 18, 2024 · 1 comment

Comments

@SetTrend
Copy link

SetTrend commented Nov 18, 2024

When targetting .NET 9 and .NET Framework 4.8.1, NuGet throws:

NU5046: The icon file 'favicon256.png' does not exist in the package.

NuGet Product Used

Visual Studio 2022 v17.12.0 (MSBuild.exe)

Product Version

NuGet Version: 6.11.0.119, MSBuild-Version 17.12.6+db5f6012c for .NET Framework, dotnet version 9.0.100

Impact

I'm unable to use this version

Repro Steps & Context

This is my project file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>net481;net9.0-windows</TargetFrameworks>
    <LangVersion>13.0</LangVersion>
    <Nullable>enable</Nullable>
    <ImplicitUsings>disable</ImplicitUsings>
    <UseWPF>true</UseWPF>
    <ApplicationIcon>favicon.ico</ApplicationIcon>
    <DebugType>embedded</DebugType>
    <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
    <GenerateDocumentationFile>True</GenerateDocumentationFile>
    <IsPublishable>False</IsPublishable>
    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
    <Title>***</Title>
    <Description>***</Description>
    <Authors>***</Authors>
    <Product>$(PackageId)</Product>
    <Copyright>2024 – ***</Copyright>
    <PackageIcon>favicon256.png</PackageIcon>
    <PackageReadmeFile>ReadMe.md</PackageReadmeFile>
    <PackageOutputPath>$(SolutionDir)\NuGet Packages</PackageOutputPath>
    <PackageTags>***</PackageTags>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DebugType>none</DebugType>
    <TreatWarningsAsErrors>True</TreatWarningsAsErrors>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="favicon.ico" />
  </ItemGroup>

  <ItemGroup>
    <None Update="favicon256.png">
      <Pack>True</Pack>
      <PackagePath>\</PackagePath>
    </None>
    <None Update="ReadMe.md">
      <Pack>True</Pack>
      <PackagePath>\</PackagePath>
    </None>
  </ItemGroup>

</Project>

Targetting solely net9.0-windows, everything is working flawlessly. But adding the net481 target, NuGet fails.

@martinrrm
Copy link
Contributor

I was able to reproduce this, if I use <TargetFramework> works, but when using <TargetFrameworks> doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants