Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title of assembly renders oddly #197

Closed
aphilpotts opened this issue Dec 5, 2017 · 4 comments
Closed

Title of assembly renders oddly #197

aphilpotts opened this issue Dec 5, 2017 · 4 comments

Comments

@aphilpotts
Copy link

Using 2.1.1 beta, .NET Framework 4.6.1

Our assembly title is dotted

[assembly: AssemblyTitle("LI.AzureTool")]

Help text then renders with just the LI part of the name, like this

> .\LI.AzureTool.exe version
LI 6.3.0.0

I fixed that by changing the title to LIAzureTool

[assembly: AssemblyTitle("LIAzureTool")]

> .\LI.AzureTool.exe version
LIAzureTool 6.3.0.0

I am not sure if there is an easy way to override this in code, or indeed if this is expected behavior

@nemec
Copy link
Contributor

nemec commented Dec 5, 2017

The code assumes the title is a filename and removes what it thinks is the extension, the last part of your title.

var title = ReflectionHelper.GetAttribute<AssemblyTitleAttribute>()
.MapValueOrDefault(
titleAttribute => Path.GetFileNameWithoutExtension(titleAttribute.Title),
ReflectionHelper.GetAssemblyName());

Does the title ever contain the file extension without adding it explicitly? If not, this is probably a bug. In the short term, you can continue to strip the . out or just add another dot to the end of the title.

@aphilpotts
Copy link
Author

Ah, in my experience it is common to NOT have a file extension, as the title appears all over the place, see https://stackoverflow.com/questions/23144872/assemblytitle-attribute-in-the-net-framework for some examples and discussion

Microsoft call it a "friendly" name and in the examples I see, has no extension, but that is hardly a definitive guide.

What I will do for now, and is just fine OK with me, is to use a space instead of a dot in the my title, but I will say this was unexpected, and could be a problem for other projects if the Title could not be changed

@ericnewton76
Copy link
Member

Yeah that looks bizarre IMO, running the Assembly Title attribute through Path functions... a title isn't a path...

I might trip this one out if somebody else doesn't beat me to it. (Still working on the build part... I'm starting to hate build.fsx)

@nemec nemec added the bug label Dec 5, 2017
@nemec
Copy link
Contributor

nemec commented Dec 5, 2017

Only thing I can think of is maybe an earlier version of the code tried to fall back to the executable name if the title was not defined and the path code was forgotten when that was removed.

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

No branches or pull requests

3 participants