Description
Describe the bug
It's possible to create and run an app within an invalid Package Name, but doing so gives a vague and unhelpful error message that does not point to the cause of the issue:
DEP0600: Deployment failed. Exception - The stub received bad data.
The stub received bad data. [0x800706F7]
The only way round this problem is to use a shorter name.
Steps to reproduce the bug
- Create a new app.
- Manually edit
Package.appxmanifest
so it includes a Name that is longer than 50 characters.
e.g.
<Identity
Name="Name.That.Is.Very.Long.But.For.Genuinely.Valid.Reasons"
Publisher="CN=myPublisherName"
Version="1.0.0.0" />
- Run the application.
- See the DEP0600 error message (above)
Expected behavior
That the provided value is outside the validation rules, it should be caught at compile time.
A message that explains (or at least references) the problem should be reported. Something like "Package name can be at most 50 characters long."
If this can only be caught at runtime, something more useful than the DEP0600 message should be displayed.
Note. There already is validation for this in the appxmanifest editor (see below) but it is a bad practice to only do input validation (& error reporting) at the point of user input when data can be provided at other times and in other ways.
It's perfectly acceptable to edit the appxmanifest file in other ways (such as notepad!) and this file may not even be opened if the contents are set in another (generated) way (such as with the Community Toolkit, or Template Studio.)
Without providing an error message that points to the actual problem, people may waste days(!) of effort trying to work out the cause of the vague error message that only has an indication of the problem if they know to open the correct file and then go to the correct tab within the UI.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.0
Windows app type
- UWP
- Win32
Device form factor
Desktop
Windows version
Windows 11 (21H2): Build 22000
Additional context
As a low priority issue, I'm not expecting this will be addressed quickly, but I hope that by documenting the issue here it may help someone else in the future if they search for the error message they will find the solution/work-around.