Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Unhandled error: Sequence contains no elements #40

Open
trampster opened this issue Oct 18, 2019 · 6 comments
Open

Unhandled error: Sequence contains no elements #40

trampster opened this issue Oct 18, 2019 · 6 comments

Comments

@trampster
Copy link

trampster commented Oct 18, 2019

I got this error trying to run dotnet-warp on a linux-arm hello world project

    Running Publish...
    Unhandled error: Sequence contains no elements

the following is my project file

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <PublishTrimmed>true</PublishTrimmed>
    <PublishSingleFile>true</PublishSingleFile>
    <RuntimeIdentifier>linux-arm</RuntimeIdentifier>
  </PropertyGroup>
</Project>
@trampster
Copy link
Author

I just read the read me and see that this tool doesn't work with dotnet core 3.0.

This is sad because I was hoping to get down the the mythical 9 MB that that hanselman got in his blog https://www.hanselman.com/blog/BrainstormingCreatingASmallSingleSelfcontainedExecutableOutOfANETCoreApplication.aspx

The best I can get with the publish trimmed etc is 29 MB

@Hubert-Rybak
Copy link
Owner

Trimming will not work, packing should work. So you can trim with 3.0 and then pack with this tool
(like https://www.hanselman.com/blog/MakingATinyNETCore30EntirelySelfcontainedSingleExecutable.aspx).
This error looks strange, could you paste output you are getting with verbose flag?

@trampster
Copy link
Author

trampster commented Oct 20, 2019

Thanks for the info. I got it going by changing my project file to:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <PublishTrimmed>true</PublishTrimmed>
    <RuntimeIdentifier>linux-arm</RuntimeIdentifier>
  </PropertyGroup>
</Project>

Then running:

  • dotnet publish -c Release
  • dotnet warp

Do you know why your tool can produce a 13 mb binary but the official one is 30 mb?

@Hubert-Rybak
Copy link
Owner

I suspect that this is because of /p:RootAllApplicationAssemblies=false which is set by this tool when running with an "aggressive" flag. This is somewhat risky and could break your app, so probably that is the reason it has been disabled.
Maybe try to set that flag on .NET Core 3.0 and see what happens?

@GreekOctopus
Copy link

Thank you . This thread helped me too.

@cristipufu
Copy link

cristipufu commented Mar 21, 2020

Had the same issue. Fixed it by removing this from .csproj:

<PublishSingleFile>true</PublishSingleFile>

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

No branches or pull requests

4 participants