Costura: Certain System.* not being embedded?

Hello!

I am an active supporter of Fody. i am using costura v5.0.2

I noticed recently that certain things like the following do not seem to be getting rolled into the exe like they used to.

System.Text.Encoding.CodePages.dll

this leads end users to run into issues when they use the software. I do see plenty of other System.* stuff in the obj folder tho

if I tweak my xml config with this

<Costura>
  <IncludeAssemblies>
    System.Text.*
    AlphaFS
CsvHelper
Exceptionless
FluentCommandLineParser
GuidMapping
Microsoft.Win32.Primitives
NFluent
NLog
RawCopy
Registry
ServiceStack.Text
ShellBagsParser
System.Buffers
System.Numerics.Vectors
System.Runtime.CompilerServices.Unsafe
  </IncludeAssemblies>
    </Costura>

I CAN see this file here and compressed, as expected:

obj\Release\Costura

but if I have a default xml config, that file does not show up in obj\Release\Costura

I also always seem to get this warning:

Fody: The package reference for Costura.Fody is missing the 'compile' part in the IncludeAssets setting; it's recommended to completely remove IncludeAssets	

which i remove but it does not seem to help.

I saw https://github.com/Fody/Costura/issues/652 and thought that would do it. i assume there is not a newer version out there later than 5.0.2?

any idea why this is happening and how to fix it?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (19 by maintainers)

Commits related to this issue

Most upvoted comments

For full .NET => yes, for .NET Core => no

Created milestones for 5.2.0 and assigned the tickets. It should auto create the release notes next time.

Just published 5.1 stable.

I can see that there’s still a pdb and a config file containing only supported runtime and binding redirects. If you want to get rid of the pdb as a separate file but still want the stack trace with source code lines information you can use the following setting in your csproj file. I like to do this to ensure that the pdb matches the exe so that I’m 100% sure the line numbers in stack traces are correct.

<PropertyGroup>
  <DebugType>embedded</DebugType>
</PropertyGroup>

And if you want to get rid of the config file, delete it and add the following settings in your csproj file so that it’s not automatically recreated:

<PropertyGroup>
  <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
  <GenerateSupportedRuntime>false</GenerateSupportedRuntime>
</PropertyGroup>

Binding redirects are useless when the dll is embedded with Costura and I think it’s not a high risk to remove the supported runtime setting which target .NET Framework 4.6.2. I’m not really sure what this does, I think it might prompt the user to install the required version of .NET framework if it’s not installed.