Coder Social home page Coder Social logo

quamotion / dotnet-packaging Goto Github PK

View Code? Open in Web Editor NEW
619.0 36.0 84.0 2.39 MB

Extensions for the .NET Core CLI which help packaging and publishing .NET Core applications

License: MIT License

C# 99.08% PowerShell 0.04% Shell 0.01% Python 0.41% Jinja 0.45%

dotnet-packaging's Introduction

Packaging utilities for .NET Core

NuGet Build status

This repository contains command-line extensions for the .NET Core CLI which make it easy to create deployment packages (such as .zip files, tarballs or installers) for .NET Core applications.

The following commands are already available:

  • dotnet tarball - Create a .tar.gz file for Linux and OS X
  • dotnet rpm - Create a CentOS/RedHat Linux installer
  • dotnet zip - Create a .zip file
  • dotnet deb - Create a Ubuntu/Debian Linux installer

And these are up next:

  • dotnet pkg - Create a macOS installer
  • dotnet choco - Create a Chocolatey package
  • dotnet msi - Create a Windows Installer (msi) package

Did we miss anything? Feel free to file a feature request, or send a PR!

Installation

First, install the .NET Packaging tools. You don't need to install all tools if you only plan to use one.

dotnet tool install --global dotnet-zip
dotnet tool install --global dotnet-tarball
dotnet tool install --global dotnet-rpm
dotnet tool install --global dotnet-deb

Then, in your project directory, run dotnet {zip|tarball|rpm|deb} install to add the tool to your project:

dotnet zip install
dotnet tarball install
dotnet rpm install
dotnet deb install

Usage

From the command line, run dotnet rpm, dotnet zip or dotnet tarball to create a .rpm, .zip or .tar.gz archive of the published output of your project.

All commands take the following command line arguments:

  • -r, --runtime: The target runtime to build your project for. For example, win7-x64 or ubuntu.16.10-x64.
  • -f, --framework: The target framework to build your project for. For example, netcoreapp1.1 or net462.
  • -c, --configuration: Target configuration. The default for most projects is 'Debug'.
  • -o, --output: The output directory to place built packages in.
  • --version-suffix: Defines the value for the $(VersionSuffix) property in the project.
  • --no-restore: Skip the implicit call to dotnet restore.

All arguments are optional.

Tutorial

Let's create a new console application and package it as a .deb file, so we can install it on our Ubuntu machine:

First, create your console application:

mkdir my-app
cd my-app
dotnet new console

Then, install the dotnet-deb utility:

dotnet tool install --global dotnet-deb
dotnet deb install

All set. Let's package your application as a deb package:

dotnet deb

There's now a bin\Debug\netcoreapp3.1\my-app.1.0.0.deb file wich you can install:

apt-get install bin\Debug\netcoreapp3.1\my-app.1.0.0.deb

Your application is installed into /usr/share/my-app. Invoke it by running /usr/share/my-app/my-app:

/usr/share/my-app/my-app

Per default a symlink will by created in /usr/local/bin pointing to your application. Therefore it should be in your path and can be invoked just by the application name.

my-app

Creating a Systemd Service

Add a my-app.service file to your project containing at least the following

[Unit]
Description=My awesome app

[Service]
Type=simple
ExecStart=/usr/local/bin/my-app

[Install]
WantedBy=multi-user.target

Add the my-app.service file to an <ItemGroup> of your .csproj with the following content to make sure that it is installed at the right place.

    <Content Include="my-app.service" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="1755">
      <LinuxPath>/etc/systemd/system/my-app.service</LinuxPath>
    </Content>

Make sure to set the Property <InstallService>true</InstallService> in your .csproj file.

Note

You can invoke the packaging tools manually, using a MSBuild target instead of using the a .NET Core CLI tool:

dotnet msbuild [your-project].csproj /t:CreateZip /p:TargetFramework=netcoreapp1.1 /p:RuntimeIdentifier=win7-x64 /p:Configuration=Release

dotnet-packaging's People

Contributors

abatishchev avatar andreasdekiert avatar bartsaintgermain avatar daniel-sherwood avatar danielmoncada avatar darkneil14 avatar franklupo avatar gep13 avatar justarchi avatar kekekeks avatar kuenzign avatar nopara73 avatar qmfrederik avatar skovvart avatar stop-cran avatar workgroupengineering avatar xsacha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotnet-packaging's Issues

Tarball output includes an empty nameless directory

There's an empty directory with no name included in the tarball output. Here's an example, viewed in 7zip:

image

When unpacking the tarball on Linux, this gives rise to a message that says:

tar: Substituting ' .' for empty member name

The message doesn't stop the extraction process, but it can be puzzling to users.

Deb package install problem

Hi,
problem to install dpkg -i myprog.deb

myprog depends on liblttng-ust0; however:
Package liblttng-ust0 is not installed.
myprog depends on libssl1.0.0; however:
Package libssl1.0.0 is not installed.

Best regards

RHEL7 with LinuxFilePath gives unknown file type

error: unpacking of archive failed on file /usr/share/pixmaps/XXXX.svg:5d1752d7: cpio: Unknown file type
error: xxxx: install failed

from

    <Content Include="Assets/xxxxxxx-logo.svg" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0644">
      <LinuxPath>/usr/share/pixmaps/xxxxxxxx.svg</LinuxPath>
    </Content>

What it the current status of `deb` packages support?

As I can see there is a feature branch for that, but it has been stalled for quite a while.

I need that feature and want to help with finishing it. What is currently missing and needs to be implemented? If I remember correctly, deb package is a combination of ar and tar.gz archives with text-based metadata files inside, so it shouldn't be as hard as RPM.

Note: I hereby confirm that I've read https://www.debian.org/doc/manuals/maint-guide/ and have packaged several Mono-based applications. I also was a maintainer of Mono packages for Maemo 5 (Debian-based OS on Nokia N900), so I know what all those fields in control files mean.

Dynamically detect the RuntimeIdentifier

Currently we require everyone to specify the RuntimeIdentifier when creating, for example, RPM packages.

We do so because we currently create self-contained applications (SPAs) which include the .NET Core runtime. Additionally, projects may take on 3rd party dependencies which contain native code; we also need to make sure we include the native dependencies for the correct runtime.

We may be able to loosen the requirement somewhat, though. The .csproj file already contains a list of target runtimes. If there's only one target runtime, or only one target runtime that makes sense for the package format, we should be able to infer that one.

Cannot package before publish.

@qmfrederik oh you here also! ๐Ÿ˜ƒ

May be related to #90 and #97, even a duplicate, not entirely sure.

Solution is a aspdotnetcore 2.2 package with a netcoreapp2.2 library.

Nuget for packaging added only to the main package.

claunia@dcsllinux /mnt/datos/Source/repos/XXXX/XXXX $ dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64
dotnet Debian/Ubuntu installer package (0.1.78+708c0e30c3)
Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/LibraryProject.csproj : error MSB4057: The target "CreateDeb" does not exist in the project.
/opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/AspDotNetProject.csproj]

If I add it to the library also:

claunia@dcsllinux /mnt/datos/Source/repos/XXXX/XXXX $ dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64
dotnet Debian/Ubuntu installer package (0.1.78+708c0e30c3)
Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/LibraryProject.csproj]
/opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/AspDotNetProject.csproj]

They just stop there

Now, if I do

dotnet publish -f netcoreapp2.2 -r ubuntu.16.10-x64

first, then

dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64

in the first case it keeps complaining about CreateDeb missing, but continues.
in the second case, no complains or warnings, it just works.

Debian Packages fail with file names > 100 characters

The TarHeader class defines the filename as char[100] so anything beyond 100 characters isn't accepted as a file name.

There seem to be various extensions to the original tar format which work around this; from the dpkg manual:

The tar archives currently allowed are, the old-style (v7) format, the pre-POSIX ustar format, a subset of the GNU format (new style long pathnames and long linknames, supported since dpkg 1.4.1.17; large file metadata since dpkg 1.18.24), and the POSIX ustar format (long names supported since dpkg 1.15.0). Unrecognized tar typeflags are considered an error. Each tar entry size inside a tar archive is limited to 11 ASCII octal digits, allowing for up to 8 GiB tar entries. The GNU large file metadata support permits 95-bit tar entry sizes and negative timestamps, and 63-bit UID, GID and device numbers.

Pre/Post Install scripts need to have LF line endings

The install scripts lifted from the XML build info need to have LF endings. Currently, CRLF from Windows authors csproj gets carried over and causes syntax errors

The conversion should also strip trailing/leading whitespace that's an artifact of XML formatting, e.g.

<PostInstallScript>
   statement
   statement
   if [ cond ]; then
       statement
   fi
</PostInstallScript>

should strip

  • the first line break and any whitespace leading up to it (right after )
  • "shared whitespace" of all statements (i.e. the first three spaces of each line)
  • any trailing whitespace of any line
  • the final line break and any whitespace leading up to it and after it

Deb How to use script?

How to use script for PreInstallScript, PostInstallScript, PreRemoveScript, PostRemoveScript?
What are the tags in project file?

Best regards

Support for PublishSingleFile

With .NET Core 3.0+, I can do dotnet publish -r linux-x64 /p:PublishSingleFile=true to get a single, self-contained executable (details). In this case, I only want the packaged archive to contain that executable. So it would be nice if I could say something like dotnet-zip -f netcoreapp3.0 -r linux-x64 --single-file to get that effect. Today, dotnet-zip will include everything in bin/Debug/linux-x64, including that single executable, which is of course quite wasteful.

If you're wondering why I would even want to archive the single executable, the reason is that it's not particularly well compressed:

$ ls -lh bin/Debug/linux-x64/publish/test-exe
-rwxr--r-- 1 alexrp alexrp 36M Jul  7 07:01 bin/Debug/linux-x64/publish/test-exe
$ zip test-exe.zip bin/Debug/linux-x64/publish/test-exe
updating: bin/Debug/linux-x64/publish/test-exe (deflated 65%)
$ ls -lh test-exe.zip
-rw-rw-rw- 1 alexrp alexrp 13M Jul  7 07:11 test-exe.zip

Feature Request - Support for Alpine APK packages

Similar to deb and rpm; dotnet alpineapk packaging would be a great addition.
Name verbosity is to disambiguate from possible future implementation of androidapk. :)

Note that Alpine packages can be downloaded and added offline from untrusted channels:

# Almquist shell (ash)

# offline install or download from some unofficial source (e.g. GH releases or CI artifacts)
# curl -O URL_TO_APK

apk add --allow-untrusted <pkgname>

# ref - https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Add_a_local_Package

Are RPM configuration files supported?

I notice that config files are always replaced when installing a new package version even in Update is used instead of Include. Looking at the code I can see that RPMFILE_CONFIG and RPMFILE_NOREPLACE are defined in IndexTag but don't appear to be used anywhere.

I'd be interested in implementing this if you could give me a pointer.

Support additional MSBuild arguments

Currently we don't allow any additional arguments to be passed to msbuild. Update the command line interface so that additional parameters which are not recognised by dotnet-* are passed to msbuild "as is".

Deb creation, setting the install path?

Is there any way we can set the install path for a deb package? Right now, it defaults to /usr/share, I'd like to specify a different directory, such as /opt/<company name>/

RPM packaging doesn't flag .NET Core DLLs as executables

In docker images where the package manage configuration suppresses the installation of documentation files (e.g. tsflags=nodocs in dnf.conf), any .NET DLLs are not installed when using package managers that observe such configuration.

The RPM packaging logic only considers ELF files as being executables (.NET Core DLLs are PE files), and non-executables are generally being packaged as documentation files, meaning the default install behavior is that everything except ELF binaries is not being installed, including none of the .NET assemblies, but also none of the other included non-ELF files, which will not at all be documentation.

Because that's not even overridable in higher-level package management utilities like yum on the command line, this ends up being a hard blocker for correct RPM packaging.

My suggestion for fixing this is to switch to an alternate strategy where documentation files are explicitly flagged as such.

error MSB4057: The target "CreateDeb" does not exist in the project

Hello,

I followed the instructions located in the readme file but I get the following error if I execute dotnet deb -r debian9.5-x64 -f netcoreapp2.2.0 command.

C:\Users\Privat\Desktop\Server-Core\Server-Core\Server-Core.csproj : error MSB4057: The target "CreateDeb" does not exist in the project

This is how my Program.cs class looks like

using Dotnet.Packaging;

namespace Server_Core
{
    class Program
    {
        static int Main(string[] args)
        {
            PackagingRunner runner = new PackagingRunner("Debian/Ubuntu installer package", "CreateDeb");
            return runner.Run(args);
        }
    }
}

This is how my Server-Core.csproj file looks like

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <RootNamespace>Server_Core</RootNamespace>
    <ApplicationIcon />
    <StartupObject />
    <Version>1.0.0.0</Version>
    <Authors></Authors>
    <Company></Company>
    <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DefineConstants>DEBUG</DefineConstants>
    <Optimize>false</Optimize>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="dotnet-deb" Version="0.1.1-*" />
	<DotNetCliToolReference Include="dotnet-deb" Version="0.1.1-*" />
  </ItemGroup>

  <ItemGroup>
    <Compile Update="Properties\Resources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
  
  <Target Name="PackageDebian" DependsOnTargets="CreateDeb" Outputs="$(DebPath)"/>

</Project>

Thank you.

Sincerley,
Chris

Fill RPM Vendor from Authors project property

As I see, RPM vendor is always empty for the created packages. I've checked the source and see this:

metadata.Vendor = string.Empty;

I'd propose to fill it from Authors project property.

The idea is to apply the same general metadata as for nuget (where Authors applies).

[Suggestion] Wiki documentation

It would be great to have a wiki documentation explaining how .csproj/.fsproj attributes and elements map to package fields.

Right now it is particularly difficult to even know how to fill things like:

Debian package section.
Package conflicts.
Package "provides".
Et al.

FHS compliance

Executables are expected to be in /usr/bin/whatever, /usr/local/bin, et all, while /usr/share is designed to be the place for architecture independent data (see https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html).

Some distros deviate slightly from the FHS but on most it's a sure thing that executables go in /usr/bin, architecture independent data (e.g. a wwwroot from asp.net) goes to /usr/share/<application_name>, and packages that require a specific directory structure (usually because they link to specific versions of libraries, like the Jetbrains tools, AfterShot, et al) install at /opt/<application_name> with a symlink in /usr/bin.

So for .NET Core >=3.0 with SingleFile enabled (see #109) the executable should be /usr/bin/<application_name> while dependent files go in /usr/share/<application_name>/

With .NET Core without single file enable (as of now) they should go to /opt/<application_name> with a symbolic link (or launch script) created in /usr/bin/<application_name>

In the later case this may be an option to not break compatibility, as well as add another option to set between symlink or launch script, and maybe environment variables to be set as part of the launch script.

In any case is the responsibility of the application developer to not assume files would be in the same folder as the executable unless strictly needed (e.g. the /opt case)

Add MSIX support

I was looking into MSIX, and it seems like a great cross-platform format for .NET apps.

Public Key RPM Package Generated

Hi, first of all thanks for this Library, so much usefull !!

I'm using it to generate an RPM package, the issue is when I have to install it in another machine, there's an error coming out saying:

warning: rpmts_HdrFromFdno: NOKEY, key ID 23b186c9 ( 0%)
error: ExampleGenerateRPM.1.0.0.linux-arm.rpm: public key not available

And I can't find any reference of how to get the public key, neither the private. Is there any way to get it or how should I do it to install the RPM generated by your library?? Any help is welcome, I have been stucked on this too much.

Thanks in advance!!
Marc.

Fix native dependency for XZ compression

RPM packages use xz compression for compressing the package payload.

Currently XZ compression is implemented via the XZOutputStream which uses liblzma under the hoods to perform the compression.

This P/Invokes into liblzma. Different Linux distributions may ship different versions of liblizma, so loading the correct version of liblzma may be a bit of a challenge. For example, on RedHad, the so name is liblzma.so.5.

We should either amend the code that loads liblzma to search for different versions of liblzma (possibly depending on the host OS); or replace liblzma by a managed implementation.

dpkg: warning: parsing file

I have a few errors when using 'sudo dpkg -I blah.deb' to install the .deb file

dpkg: warning: parsing file '/var/lib/dpkg/tmp.ci/control' near line 5 package
...
missing description
missing maintainer
missing version

I have .csproj fields for <Description><Company><Authors> <VersionPrefix><VersionSuffix> so not sure if these are the ones that are supposed to map into the .deb control file or if the information is supposed to come from somewhere else. I'm looking in the project for examples or notes on this.

Linux ARM deb packages have the wrong architecture

I want to create a deb package for ARM processor. (Raspbian - Raspberry PI)

$ dotnet deb -f netcoreapp2.0 -r linux-arm -c Release

after copying to the target and trying to install, I get the following error

pi@raspberrypi:~ $ sudo dpkg -i GPIOExample.1.0.0.linux-arm.deb                                                                                                      
dpkg: error processing archive GPIOExample.1.0.0.linux-arm.deb (--install):                                                                                          
 package architecture (amd64) does not match system (armhf)                                                                                                          
Errors were encountered while processing:                                                                                                                            
 GPIOExample.1.0.0.linux-arm.deb   

It seems that the package architecture is not set correctly.

MSI support status?

Love this effort.

What's the status of the MSI support integration at this point? There has obviously been quite a bit of work done with WiX -- how far is that away from being usable?

PostInstallScript and friends adds #!/bin/sh

Currently the PostInstallScript (and others) adds #!/bin/sh to the script.
https://github.com/qmfrederik/dotnet-packaging/blob/63b290277b4c8b7d3f09f696c2307740f0a12e52/Packaging.Targets/Deb/DebPackageCreator.cs#L176

The way I've been using this is to have MSBuild read in a file from disk that I've specified as the postinstall script. I've already added my shebang to the file, but when I go to deploy it has double them now. I think this should be up the user to add their shebang.

[Feature] ArchLinux package format

This would be pretty easy to do as it's merely a .tar.xz with some text files including paths, dependencies, etc, and bash scripts for post/pre install.

LinuxPath doesn't appear to be working with DebTask

  <ItemGroup>
    <LinuxFolder Include="/etc/myapp" Group="myapp" Owner="myapp" RemoveOnUninstall="true" />
    <Content Include="myapp_config.svc.yml" CopyToOutputDirectory="PreserveNewest"> 
      <LinuxPath>/etc/myapp/myapp_config.yml</LinuxPath>
    </Content>
    <Content Include="myapp_config.machine.yml" CopyToOutputDirectory="PreserveNewest">
      <LinuxPath>/etc/myapp/myapp_config.yml</LinuxPath>
    </Content>
  </ItemGroup>

At present, the two files end up in the application directory and not in /etc.

Dependency version not set when using version field

On .csproj:

  <ItemGroup>
    <DebDependency Include="iproute2"/>
    <DebDependency Include="net-tools"/>
  </ItemGroup>

  <ItemGroup Condition="'$(RuntimeIdentifier)' == 'debian.8-x64' Or '$(RuntimeIdentifier)' == 'ubuntu.14.04-x64' Or '$(RuntimeIdentifier)' == 'ubuntu.16.04-x64'">
    <DebDependency Include="initscripts" Version=">= 2.88dsf-13.3"/>
  </ItemGroup>

On control file gets:

Depends: iproute2, net-tools, initscripts, libc6, libcurl3, libgcc1, libgssapi-krb5-2, liblttng-ust0, libssl0.9.8 | libssl1.0.0 | libssl1.0.1 | libssl1.0.2, libstdc++6, libunwind8, libuuid1, zlib1g, libicu52 | libicu53 | libicu54 | libicu55 | libicu56 | libicu57 | libicu58 | libicu59 | libicu60 | libicu61 | libicu62 | libicu63

Error MSB4057: The target "CreateDeb" does not exist in the project.

I saw the response to the other post and have made sure i have entry under ItemGroups . Is there something i missed in the readme?

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>	
    <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
    <RootNamespace>myprogram</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="FirebaseDatabase.net" Version="4.0.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.4" />
    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
    <PackageReference Include="RabbitMQ.Client" Version="5.1.0" />
	<PackageReference Include="Packaging.Targets" Version="0.1.56" />
  </ItemGroup>

  <ItemGroup>
    <None Update="config.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ProjectExtensions><VisualStudio><UserProperties /></VisualStudio></ProjectExtensions>

</Project>

Deb package fields

Hi,
how to specify fields Priority,Section,Homepage,Installed-Size ?

Best regards

Current version (0.1.78) does not support netcoreapp2.2

Doing a nuget upgrade, I get the following error:

Error	NU1202	Package dotnet-deb 0.1.78 is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2). Package dotnet-deb 0.1.78 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1) 		

Note that version '0.1.70' works just fine

Packaging fails after updating dotnet sdk to 2.1.403

In particular the build fails since fsprojects/FAKE@d0cda20 and the only relevant change there seems to be the 402 -> 403 update (which I have confirmed locally).

The issue seems to happen if you use a "local" dotnet cli installation via script (not via installer) combined with a global installation of a different version.

Reproducing the issue

Repro:

  1. Uninstall all dotnet SDK versions
  2. Install 2.1.402 (which is the version installed globally on appveyor at the time of writing)
  3. Run the following code
git clone https://github.com/fsharp/FAKE.git
git checkout 649cb005ffe3c7438167d6439bff822cdc1fdac9
dotnet tool install -g fake-cli
fake build -st DotNetCoreCreateDebianPackage

The script will download and install a local "dotnet sdk" with the version 2.1.403 (as it notices that only 2.1.402 is installed globally). After downloading it will invoke the msbuild target (you can run the printed msbuild command standalone)

Expected result

works

Actual result

  Creating DEB package 'C:\proj\FAKE\src\app\fake-cli\bin\Release\netcoreapp2.1\linux-x64\fake-cli.5.8.3.linux-x64.deb' from folder 'bin\Release\netcoreapp2.1\linux-x64\publish\'
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018: The "DebTask" task failed unexpectedly. [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018: System.TypeInitializationException: The type initializer for 'Packaging.Targets.IO.NativeMethods' threw an exception. ---> System.IO.FileLoadException: Could not load liblzma. On Linux, make sure you've installed liblzma-dev or an equivalent package. [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.IO.NativeMethods..cctor() [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    --- End of inner exception stack trace --- [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.IO.NativeMethods.lzma_easy_encoder(LzmaStream& stream, UInt32 preset, LzmaCheck check) [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.IO.XZOutputStream..ctor(Stream s, Int32 threads, UInt32 preset, Boolean leaveOpen) [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.DebTask.Execute() [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]

Workaround

Do not use locally installed dotnet cli version?

Deb installservice error on Ubuntu

Using InstallService, you get the following error message when it tries to run:

Too few arguments.

It's because the following command is not valid:

pkg.PostInstallScript += $"systemctl reload\n";

Should this be updated to

pkg.PostInstallScript += $"systemctl daemon-reload\n";?

doe sn't have a target for '.NETCoreApp,Version=v2.1/ubuntu.16.04-x64'

I do not understand what is wrong, I have done so to do.

C:\Users\testing\source\repos\Linux-test-deb>"C:\Program Files\dotnet\dotnet.exe
" deb  -f netcoreapp2.1 -c release -r ubuntu.16.04-x64
dotnet Debian/Ubuntu installer package (0.1.78+708c0e30c3)
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\dotnet\sdk\2.1.503\Sdks\Microsoft.NET.Sdk\targets\Microsoft.Pac
kageDependencyResolution.targets(198,5): error NETSDK1047: Assets file 'C:\Users
\testing\source\repos\Linux-test-deb\Linux-test-deb\obj\project.assets.json' doe
sn't have a target for '.NETCoreApp,Version=v2.1/ubuntu.16.04-x64'. Ensure that
restore has run and that you have included 'netcoreapp2.1' in the TargetFramewor
ks for your project. You may also need to include 'ubuntu.16.04-x64' in your pro
ject's RuntimeIdentifiers. [C:\Users\testing\source\repos\Linux-test-deb\Linux-t
est-deb\Linux-test-deb.csproj]
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RootNamespace>Linux_test_deb</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Packaging.Targets" Version="0.1.78" />
  </ItemGroup>

</Project>

Setuid/setgid/sticky permissions are ignored

Example
Well for me it's failing also..

  <ItemGroup Condition="$(RuntimeIdentifier.StartsWith('linux')) == false">
    <None Include="../xxxxx-binaries/binary" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="4755"/>
    <None Include="../xxxxx-binaries/lib/*" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755" Link="lib\%(Filename)%(Extension)"/>
    <None Include="../xxxxxx-binaries/lib/engines/*" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755" Link="lib\engines\%(Filename)%(Extension)"/>
  </ItemGroup>

binary gets 0755 permissions, both on deb and rpm packages.

Deb updating an existing package causes not found error when trying to remove?

When updating an existing deb package on Ubuntu 16.04 server LTS, the following error is shown:

(Reading database ... 58911 files and directories currently installed.)
Preparing to unpack test.0.0.1.linux-x64.deb ...
Unpacking test (0.0.1) over (0.0.1) ...
/var/lib/dpkg/info/test.postrm: 2: /var/lib/dpkg/info/test.postrm: /usr/bin/rm: not found
/var/lib/dpkg/info/test.postrm: 3: /var/lib/dpkg/info/test.postrm: /usr/bin/rm: not found

Looks like it might be a PATH issue? Note that rm is indeed available in /usr/bin/rm.

Update: Appears this happens only when RemoveOnUninstall is set.

Global tools

Any plans to make these commands work as part of the new dotnet global tools release?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.