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 publishing how do I target specific .NET Core Runtimes? #8

Open
nicksterx opened this issue Nov 29, 2018 · 0 comments
Open

When publishing how do I target specific .NET Core Runtimes? #8

nicksterx opened this issue Nov 29, 2018 · 0 comments

Comments

@nicksterx
Copy link

Topic
Target specific .NET Core Runtimes, specifically the win RID because that is the only platform I am targeting.

On my CI/CD server I publish my applications with this command:

dotnet publish -c Release -o ..\publish

It outputs a runtimes directory with the following sub-directories:

    - publish/runtimes/
       - debian.8-x64/
       - fedora.23-x64/
       - fedora.24-x64/
       - opensuse.13.2-x64/
       - opensuse.42.1-x64/
       - osx/
       - osx.10.10-x64/
       - rhel.7-x64/
       - ubuntu.14.04-x64/
       - ubuntu.16.04-x64/
       - ubuntu.16.10-x64/
       - unix/
       - win/ 

Is there a way to configure the project to only output the win runtime folder?

Scope
I only plan to publish this application on Windows 2016 Server so the OSX/Linux/Unix runtimes folders are not necessary. In several cases these runtimes folders contain known vulnerable dlls which lead to false positive OSA scans.

Why do i request this?
I have tried adding the win10-x64 and win10-x86 RIDs in the my project file's element:

<RuntimeIdentifiers>win10-x64;win10-x86</RuntimeIdentifiers>

The output of adding the RIDs to my csproj files is the same as if I did not specify the RIDs in those files.

When I run CI/CD command example

dotnet publish -c Release -r win10-x86 -o ..\publish

I believe it creates a self-contained deployment. As my publish directory goes from being 55MB to 120MB and from 237 files to 482 files. It also matches the output if I included the --self-contained flag.

Thank you for your time and help!

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