LosManos
LosManos

Reputation: 7692

What does the file ilmerge.internalize.exclude.txt do?

While code reviewing I found the following in a csproj file:

<ItemGroup>
    <Content Include="ilmerge.internalize.exclude.txt" />
</ItemGroup>

No such file exists in my source code directories.
Though I find the file in ..packages..\content and ..\bin\Debug\
They all contain the a namespace (removed from this question) followed by an asterisk. ..Web.Api.*

I guess it stems from ILMerge but cannot say how.

I guess I can safely remove the ItemGroup element. Right?

Edit

Present theory is that the files comes from a badly written dependency that utilises ILMerge to not expose its own dependencies. During some rework we managed to make it do the opposite, expose everything, plus even the file ilmerge.internalize.exclude.txt was carried over.

The very question is still unanswered though - what the file does.

Upvotes: 4

Views: 901

Answers (1)

Janis Veinbergs
Janis Veinbergs

Reputation: 6988

This comes into effect when you specify /internalize:ilmerge.internalize.exclude.txt flag for ILMerge - whatever type was public, becomes internal, except what is listed within ilmerge.internalize.exclude.txt. Internalizing Assemblies with ILMerge

This file allows you to set types/namespaces via regex which you want to leave access modifier as-is (public). That is in each line you can specify fully qualified name for type to exclude from internalization (NOT internationalization):

Namespace\.Typename
Namespace2\..*

Not escaping dot will also work as within regex, a dot means any char.

You may want to see MSBuild output log whether your project uses ILMerge somehow.

Upvotes: 3

Related Questions