Universal Windows Platform app registration fails - blocked by AppLocker - windows

Deploying a UWP app locally from Visual Studio 2015 (Update 3) fails with the error message:
DEP0700 : Registration of the app failed. error 0xC000003A: Deployment
of package 6dd81a71-9c3a-4204-abaf-886a9b0c29bb_1.0.0.0_x86__kcdnnw7pbsh48 was
blocked by AppLocker. (0x80073cf9)
The full output doesn't add further insight:
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
1>------ Build started: Project: App2, Configuration: Debug x86 ------
1> App2 -> c:\users\<username>\documents\visual studio 2015\Projects\App2\App2\bin\x86\Debug\App2.exe
2>------ Deploy started: Project: App2, Configuration: Debug x86 ------
2>Updating the layout...
2>Copying files: Total <1 mb to layout...
2>Checking whether required frameworks are installed...
2>Registering the application to run from layout...
2>DEP0700 : Registration of the app failed. error 0xC000003A: Deployment of package 6dd81a71-9c3a-4204-abaf-886a9b0c29bb_1.0.0.0_x86__kcdnnw7pbsh48 was blocked by AppLocker. (0x80073cf9)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
This has been created as new project via File > New > Project... > Blank App (Universal Windows), with no other changes being made.
Visual Studio is running as Administrator.
Windows 10 (1607 Build 14393) is set up with Developer mode on.
Other suggestions include deleting the app directory from %LocalAppData%\Packages, but there is no directory corresponding to this app.
What could the issue be here? Is there any advice on next steps to troubleshoot this?

Had this same error popping up with Visual Studio 2017 every time I tried to open a XAML file in UWP project. Fixed it by simply creating the folder C:\Windows\System32\AppLocker.

I faced the exact same situation you described last week. It’s taken some time to come back to you as I wanted to go through all the “fix it” options first. I tried all you mentioned and to no avail. You don’t mention it, but I’m guessing you are also using the Pro edition?
I then looked a little more broadly, and found many other users having the same problem installing or updating apps from the Windows store after “upgrading” to the anniversary edition of Windows 10, which you mention you are using. The error code is the same and AppLocker is again the culprit, so it would be worth you testing a new download from the store to see if this is also true for you.
If so, it seems to be because Microsoft has decided to limit some of the useful policy configuration which was previously available in Pro, and now only available in Enterprise or Education. One of the changes that is affecting us is to limit the usage of AppLocker. It’s a real shame and at odds with the push to make a really polished version of Visual Studio and Xamarin (ok – Xamarin is still a little buggy) available on a community license, but then at the same time, changing the OS so that to use the free development tools, you will need an Enterprise license. And normally, the Enterprise edition for Win 10 is only available with a bulk purchase! This blog is a good summary of the changes that have been made in the anniversary edition.
There are two more fixes you could try – run wsreset.exe from a command prompt with admin rights or download this trouble shooter from the MS site. These will try to fix your Windows store configuration, which might also help with UWP deployment. Neither worked for me, but some people online mentioned it worked for them.
So I am facing the tedium of a fresh Windows 10 install – either to go back to the previous version and stop the update to the anniversary edition by tweaking the wifi access… or finding a fresh install of the anniversary edition. I’m going to try the former first as it is one less download, though I’ll still need to download all of the whopping 35gb of Visual Studio and Xamarin again so will wait until I have some spare time!

This worked for me:
Delete all the CI policies here
C:\windows\System32\CodeIntegrity\CiPolicies\Active* (Should be p7b files)
Reboot

Related

What is the minimal install footprint to be able to open a sln with a .CloudService

I'm opening a solution which has a dependency on an outdated version of the Azure SDK such that Web PI wont install it.
This leaves me with the following error when I build the project:
WAT080 : Failed to locate the Microsoft Azure SDK. Please make sure the Microsoft Azure SDK v2.7 is installed.
What's the least amount of
steps I need to execute and
junk I can put into my environment
to make it load in VS and compile?
Navigate to the archived downloads page: https://azure.microsoft.com/en-gb/downloads/archive-net-downloads/
Follow the trail via the appropriate Azure SDK for .NET (As of Mar 2017, v2.7.1 is here)
Click the download button
Select MicrosoftAzureAuthoringTools-x64.msi
Select MicrosoftAzureLibsForNet-x64.msi <- x86 is not useful
Select MicrosoftAzureTools.VS140.exe <- 14:- VS 2015
I downloaded and installed each separately
HACK: My installation of VS2015 was slightly mangled, so I was still seeing a message from VS offering to install the 2.7 tools. I was able to get over that by installing the latest (2.9 at time of writing) tools, whereupon I got a clean build. I'll be doing a clean reinstall of VS and will research whether that can be avoided

Xamarin 4.1.1.3 install fails requiring Build Tools that are already installed

I have VS Community 2015 installed on a Windows 7 machine.
Few days ago new Xamarin version, the 4.1.1.3 one, has been released.
I have tried to install it (upgrading from 4.1.0.350) many times but every time I receive message about Build Tools requirement, even if the Build Tools 2013 and 2015 are correctly installed on the machine.
I have tried to reinstall Build Tools, repair VS and actual Xamarin installation without any success.
What may I check to be able to upgrade?
Thanks in advance for any help I will receive.
Am not sure if you were lucky enough to find a solution yet.
I faced a similar issue and was able to overcome it by :
1)First running the VS as Administrator.
2)Then Follow the normal update process Via Tools -> Options -> Xamarin -> Other
You will be asked to close VS during installation which is OK.
I guess that means the update process needs to access some files which require Admin rights? anyway it worked for me and I hope it works for you as well.
All the best!.
Br,
Khalid

"aapt.exe" exited with code 255

Trying to setup my build server for Xamarin Android builds, but i constantly keeps getting into this issue:
[error]C:\Program Files
(x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1832,3):
Error MSB6006: "aapt.exe" exited with code 255.
Anyone know what this error code means? We dont have this issue on the teams local computers. So i assume i am missing something on the build machine, but cannot figure out what.
Visual Studio Team Services Build Agent
MS 2012 R2 Datacenter
Visual Studio 2015 Community
Android SDK Manager w/all SDK's up til revision 24
Xamarin 6.1.1.0
There must be a problem in build tool. So, can you compare the installed build tool version in your local machine and build machine.
Note: Add the following line under PropertyGroup tag in your project file to specify the build tool version.
<AndroidSdkBuildToolsVersion>23.0.3</AndroidSdkBuildToolsVersion>
I believe you are probably missing some files in your SDK manager for android. Open the sdk manager and ensure you have downloaded all API levels you are targeting as well as the up to date build tools and extras.

Visual Studio Cordova App, can't run debugger - Could not locate the appxrecipe file

If I create a brand new Cordova project (JavaScript or TypeScript) and try to debug on Ripple or on the local machine I get an error during build that says "Could not locate the appxrecipe file."
I googled it and nothing comes up. What is this file and how does it get generated? Shouldn't it be generated when I create the project?
I've already lost an entire day to this, running repairs on visual studio and trying things that had no effect. Frustrating!
This took a while to figure out but it seems that the version of node.js that would get installed with Visual Studio was too old (0.10.x). When I installed the x64 version of node.js from the node website, it installed a 64 bit version which also wouldn't work with Cordova in Visual Studio.
The answer was to install the 32bit version of node.js (node-v5.1.0-x86.msi) available from their website. Now everything compiles correctly!
I was also stucked with the issue but my problem was little bit different. I wanted to build a project for Windows 10 Mobile platform.
It was really weird because everytime when I tried to build a project from CLI with ionic build windows, the build was successul. But it had been throwing the error about appxrecipe file while building with Visual Studio again and again.
Then I noticed that everytime I open a project in Visual Studio (2015, Community Edition) there is one change when you open your confix.xml file in Visual Studio editor - the change was that Windows Target Version was set to 8.1 again. I tried to change it to Windows 10 again, save it and build but the error was still there.
I have solved it with installation of Microsoft Emulator for Windows 10 Mobile and it works like a charm now. Maybe this information could be helpful for somebody...

Cannot load shared 'project' in Windows Universal app after upgrading to Azure SDK 2.6

I've just installed the April 2015 release of the Azure SDK. It is version 2.6 and previously I was on 2.5. Now one of my projects will not load. It is the shared project in a Windows Universal application.
When I right-click the project and choose 'reload' I get the pop-up error
The method or operation is not implemented
The output window gives more detail:
Things.Shared.shproj : error : The composition produced a single
composition error. The root cause is provided below. Review the
CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.ProjectSystem.References.IBuildDependencyProjectReferencesService
RequiredTypeIdentity Microsoft.VisualStudio.ProjectSystem.References.IBuildDependencyProjectReferencesService
Resulting in: Cannot set import
'Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService.ProjectReferencesService
(ContractName="Microsoft.VisualStudio.ProjectSystem.References.IBuildDependencyProjectReferencesService")'
on part
'Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService'.
Element:
Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService.ProjectReferencesService
(ContractName="Microsoft.VisualStudio.ProjectSystem.References.IBuildDependencyProjectReferencesService")
--> Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService
Resulting in: Cannot get export
'Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService.WireUp
(ContractName="Microsoft.VisualStudio.ProjectSystem.ConfiguredProject.AutoLoad")'
from part
'Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService'.
Element:
Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService.WireUp
(ContractName="Microsoft.VisualStudio.ProjectSystem.ConfiguredProject.AutoLoad")
--> Microsoft.VisualStudio.Azure.Deployment.ProjectReferenceMaintenanceService
The other parts to the Windows Universal app (the Windows 8.1 project and the Windows Phone 8.1 project) have two Azure NuGet packages installed: Windows Azure Mobile Services 1.3.2 and Windows Azure Storage 4.3.0. (N.B. Those two projects load without issue.)
This is not a show stopper for me since uninstalling the Azure SDK 2.6 removes the load failure. To uninstall I go via the Control Panel to 'uninstall or change a program' and then uninstall Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.6
I would like to know how to fix this without uninstalling the Azure SDK 4.6.
Over on the Azure Mobile Services forum Chuck Weininger has posted the following answer:
The [fixed] build of Azure SDK 2.6 is now available, but it may not have
propagated to all download servers yet.
You can run the Web Platform Installer and if you don’t have the new
build installed, it should allow you to install 2.6 again. But it
might not if you are accessing a download server that doesn’t have the
new bits yet. If WebPI doesn't allow you to install 2.6 again, then
wait a few hours and try again.
The build number for the version with the fixes is build
2.6.30508.1601. You can identify the build of the SDK from Control Panel -> Programs and Features -> Microsoft Azure Tools for Microsoft
Visual Studio 2013 – v 2.6. The Version column will display the build
number
I have followed Chuck's instructions and have the new build and the shared project now loads without issue.
We have been able to reproduce the issue, but don't have a workaround at this time. If you want to use the Universal App projects with VS 2013, you will have to uninstall Azure SDK for VS 2.6. The issue does not happen on VS 2015 RC if you would like to give that a try. We hope to have news soon about how we can get a fix for this issue on VS 2013.
Chuck Weininger, Dev Lead, Microsoft
https://social.msdn.microsoft.com/Forums/en-US/e8123821-dcb1-477f-a746-f6f016a724ea/cannot-load-shared-project-in-windows-universal-app-after-upgrading-to-azure-sdk-26?forum=azuremobile&prof=required#de621720-3afc-458c-ba85-f691be9e74c1

Resources