• 0

C# Metro App (name, version, etc)


Question

Hello gang,

I am migrating an application from VB to C#/Metro. Currently I am attempting to get the app name and version. In standard c# (non-Metro) I can get the app name with:


string sAppName = Assembly.GetEntryAssembly().GetName().Name;
[/CODE]

However these are not available in Metro apps (I'm planning on this app being available for Phone and Surface) Any thoughts?

Thanks

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

var packageName = Windows.ApplicationModel.Package.Current.Id.Name;
var packageVersion = Windows.ApplicationModel.Package.Current.Id.Version;

That should get you both. If your package name is set as a Guid still that's all you will get for the name. :/

Link to comment
Share on other sites

  • 0

var packageName = Windows.ApplicationModel.Package.Current.Id.Name;
var packageVersion = Windows.ApplicationModel.Package.Current.Id.Version;

That should get you both. If your package name is set as a Guid still that's all you will get for the name. :/

Thank you kindly, that will at the very least give me a start.

Have a great day

Link to comment
Share on other sites

This topic is now closed to further replies.