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

Linux dotnet publish fails to add metadata to exe #5338

Closed
Fireant456 opened this issue Oct 13, 2020 · 9 comments
Closed

Linux dotnet publish fails to add metadata to exe #5338

Fireant456 opened this issue Oct 13, 2020 · 9 comments
Labels
duplicate Indicates duplicate issues

Comments

@Fireant456
Copy link

Fireant456 commented Oct 13, 2020

Although my csproj contains the values to add to the file metadata, running dotnet publish on CentOS 7 Linux fails to apply metadata without any errors...

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <ApplicationIcon>favicon.ico</ApplicationIcon>
    <PackageIcon>favicon.ico</PackageIcon>
    <PackageId>SupportTool</PackageId>
    <Authors>Sonoran Software Systems LLC</Authors>
    <Product>Sonoran Support Tool</Product>
  </PropertyGroup>

When I build on Windows 10 it applies the metadata as expected.

On both OSes I use the following publish command...
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true

@mairaw
Copy link
Contributor

mairaw commented Oct 13, 2020

win-x64 is a Windows identifier. If you're running on Linux and you want to specify a Linux runtime, then you should use the appropriate RID listed at https://docs.microsoft.com/dotnet/core/rid-catalog. Probably linux-x64 would be the right one for your machine.

@Fireant456
Copy link
Author

I am running the compiled code on Windows, not Linux. I did attempt to change that option on the compile command but that did not help with the metadata.

@Fireant456
Copy link
Author

@mairaw don't know if you subscribe to the issues you respond in. Pinging so that you can see I responded :)

@vitek-karas
Copy link
Member

This is a known problem - no Win32 resources will be added to the executable if built on non-Windows platform.

@mairaw
Copy link
Contributor

mairaw commented Oct 23, 2020

@vitek-karas is this by design or is there another issue capturing that?

@vitek-karas
Copy link
Member

There is an issue - I just can't find it right now :sad:

@vitek-karas
Copy link
Member

Finally found it - at least one (there are many copies of this, I'm trying to consolidate): dotnet/runtime#3828

@mairaw
Copy link
Contributor

mairaw commented Oct 23, 2020

Thanks @vitek-karas. So closing this one as a duplicate.

@mairaw mairaw closed this as completed Oct 23, 2020
@mairaw mairaw added the duplicate Indicates duplicate issues label Oct 23, 2020
@fabiang
Copy link

fabiang commented May 17, 2023

For those reviewing the upstream issue: I've also have this problem when building inside a Windows Container (namely mcr.microsoft.com/dotnet/sdk:6.0) on Windows Server 2019.

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

No branches or pull requests

4 participants