I have a project which embeds some files into it, two of which ends with .SMS.something
.
When the project is compiled, a satellite assembly for the "SMS" culture is generated even though I have not specified anywhere that I want to use satellite assemblies, and is it even a culture?
I have searched all over the place for an explanation, but I am at a loss. The only things I found were people trying to embed their resource assemblies for actual cultures into their executable, but this is not my case. I just want to have all my embedded resources, which are only in one language, to be in the same assembly.
How can I prevent this automatic generation of satellite assemblies, or specify that SMS is not a culture?
I managed to solve this in a very hacky put perfectly working way by looking in the Microsoft.Common.targets and Microsoft.CSharp.targets and figuring out what tasks actually sorted the resources and gave them names.
So I override the CreateCSharpManifestResourceName task with one that set the ManifestResourceName and LogicalName to be something along the lines of what i want:
As an added bonus, the files i embed get their actual path (only with
\
replaced with/
) as their resource name, and thus can be easily looked up usingAssembly.GetManifestResourceStream(x)
where x would be e.g./path.to/my.SMS.file
.And then I override the AssignCulture task with one that just returns that none of the files had any culture, and adds
<WithCulture>false</WithCulture>
to them (which fits perfectly in my case):