问题
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 an not 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://docs.microsoft.com/en-us/windows/application-management/sideload-apps-in-windows-10
- Set the Target machine for Sideload
- Created the test cert via Visual Studio
- Added the test cert to Package app manifest in Visual Studio
- Compiled the UWP app in Release
- Manually installed the Test Cert to the Target machine's Trusted Root Certification Authorities folder
- 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?
回答1:
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
}
来源:https://stackoverflow.com/questions/57597193/cannot-sideload-win10-uwp-application-without-developer-mode-developer-license