2

I'm developing a Line of Business application to be installed on multiple PC's, but I cannot get the Sideload to finish successfully.

I receive the following error from the Add-AppDevPackage script:

"Could not acquire a developer license"

If I set Developer Mode, my problems go away. But... That is not an option for the app's software deployment.

My setup: Visual Studio 2017, Win10 v. 1903 on the Development machine, Win10 v. 1809 on the Target machines

Per Microsoft's documentation: https://learn.microsoft.com/en-us/windows/application-management/sideload-apps-in-windows-10

  1. Set the Target machine for Sideload
  2. Created the test cert via Visual Studio
  3. Added the test cert to Package app manifest in Visual Studio
  4. Compiled the UWP app in Release
  5. Manually installed the Test Cert to the Target machine's Trusted Root Certification Authorities folder
  6. Ran the Add-AppDevPackage script on the Target machine

This was no help: Install developed Application without developer mode

I have no interest in putting software on the Microsoft Store for Business as outlined here: Install UWP without developer-mode and sideloading

This says I need yet another app??? (AppInstaller) to make sideloading work: How to created a UWP app with a certificate that can be sideloaded

I could modify the Powershell script to eliminate the Developer License check, but it seems like I shouldn't have to brute force the sideload.

The answer here is to hack the Poweshell script as I mentioned earlier, but does not explain why the Developer Check is out there in the first place: UWP's 'Add-DevAppPackage' Powershell script checks for a developer licence. This is an issue for Sideloading?

Jeffrey M
  • 133
  • 14
  • Hi, can you provide a more detailed reproducible step? Please check if your certificate is imported into the **Trusted Root Certification Authorities** folder. – Richard Zhang Aug 22 '19 at 01:49
  • @RichardZhang-MSFT Yes, the test cert is in Trusted Root Certification Authorities. Better question: why is the Visual Studio auto gen Add-AppDevPackage script specifically looking for a developer license on the Target machine? When I force function CheckIfNeedDevloperLicence to $false, the app sideloaded fine. – Jeffrey M Aug 22 '19 at 12:44
  • Hi, nice to see you solved the problem. If you can, you can write your solution steps as answers, which will help more people. Regarding the problem you mentioned, there is currently no document explaining this behavior. It should be to ensure that the user knows the source of the application. By default, the computer only allows applications that are certified by the Microsoft Store, and Microsoft guarantees the security of the application. Opening the developer mode means that the user is responsible for the source of the application. – Richard Zhang Aug 23 '19 at 03:07

1 Answers1

4

Not a fan of having to do this to code that should be "turn key", but this allows sideloading without the Developer License check error and install fail.

Modify Add-AppDevPackage.ps1:

#
# Checks whether the machine is missing a valid developer license.
#
function CheckIfNeedDeveloperLicense
{
    $Result = $true
    try
    {
        $Result = (Get-WindowsDeveloperLicense | Where-Object { $_.IsValid } | Measure-Object).Count -eq 0
    }
    catch {}

    return $false #$Result
}
Jeffrey M
  • 133
  • 14