My XBAP deployment fails on user account, while administrators can run it well – what to do?
I know only one person, who has following problem, however it makes sense to post all steps to perform in order to solve the problem. Let’s start from the error:
While trying to run XBAP application with user’s account on my machine, I get following error:
System.UnauthorizedAccessException was unhandled Message="Access is denied. (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED))" Source="System.Deployment
while administrators on the same machine have no problem to run the same XBAPs.
Side note: Similar problems might be while running XPS viewer directly from Internet Explorer.
Declaimer: This posting is provided "AS IS" with no warranties, and confers no rights. Following methods are not an officially supported feature. You can use it strictly for debugging purposes.
Following steps you should take in order to find the root of the problem
- Check it your users able to get cookies (they should be able to write into isolated storage)
in order to do it, repair simple HTML page on web server in the same security zone and put following code theredocument.cookie = "testxbapcookie=whatever;expires=
12/12/2999 00:00:00";
var c =document.cookie.match ( '(^|;) ?testxbapcookie=([^;]*)(;|$)' );
if(c) - Next step is to check if the user able to write into storage. To do it try to copy and then read some file into "documents and settings\[USERNAME]\Local Settings\Apps\2.0" directory. If you cannot – ask the administrator to give full access to the user to this directory – it’s the user’s own directory
- Next step is to check ability of the user to write into some registry key. Try to write something into HKCU\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0 if you cannot – ask administrator to give right for this node. Alternatively, you can run simple .NET program.
Guid ri = new Guid("a5c62f6d-5e3e-4cd9-b345-6b281d7a1d1e");
object o = GetUserStore(0,IntPtr.Zero, ref ri);if it failed, enable the access for this node. If you want to me general, check whether client can read HKCU\Software\Classes before. Also you can check and access to HKCR\Interface\{79EAC9C9-BAF9-11CE-8C82-00AA004BA90B} registry node.
- If the problem still exists, ask administrator to go to HKLM\SOFTWARE\Microsoft\.NETFramework\Windows Presentation Foundation\Hosting node in registry and create DWORD RunUnrestricted=1 value. This will force PresentationHost to restart itself might solve the problem. Please note, setting RunUnrestricted value might have side effects
- If you still have a problem – try to delete and recreate the user or reinstall your operation system.
document.cookie = "testxbapcookie=whatever;expires=12/12/1999 00:00:00";
else
alert("cannot set cookie");
If you see alert – enable cookie support for this security zone
Have a nice day and don’t fall with problem – if you do not really need XBAP – do not use it!
You may also be interested with:
- Windows 7 – dry run or how things should be done to correct old mistakes
- TFS licensing model demystification or what should I buy for my company in order not to step on the licensing mine?
March 11th, 2008 · Comments (1)
One Response to “My XBAP deployment fails on user account, while administrators can run it well – what to do?”
Leave a Reply
Discover other tags
My tools
- .NET Framework Detector
- Duplicate images finder
- Exchange Security Policy for Windows Mobile Devices Fix
- Gas Price Windows Vista SideBar gadget
- Israel Traffic Information Windows Vista SideBar gadget
- Localization fix for SAP ES Explorer for Visual Studio
- LocTester
- RTL and LTR in Windows Live Writer
- Silverlight controls library
- Snipping tool integration plugin for WLW
- USB FM receiver library
- Vista Battery Saver
- WebCam control for WPF
- Windows Live SkyDrive attachment for Windows Live Writer
- Wireless Migrator
- WPF Virtual Keyboard




January 1st, 2009 at 12:41 am
Having installed some new RAM to boost WPF apps, it didn’t get along with the existing RAM and I ended up with a corrupt user profile on XP. It would have been extremely painful to re-install and configure all sorts of software, so I managed to rebuild the profile from a backup. One thing alone just would not work – viewing XAML, XPS or an XBAP outside of VS (in IE) – I have had to log on under a new user account which is a real pain. The RunUnrestricted fix has worked, so thank you. I’m hoping there are no side effects but I urge MS to formalise the fix in WPF 3.5 SP1 in case there are end users who have given up trying to run non standalone WPF.