WebBrowser control in WPF throws access denied exception

-1

I have a web browser control in my WPF UI. The project is a class library. Everything works fine when the dll is loaded by logonui.exe and explorer.exe. But I get an exception at InitializeComponent() when the same dll is loaded by credentialuibroker.exe.

The error indicates that CoCreateInstance is failing with ACCESSDENIED when creating a browser object. Any ideas on how do I fix it? I have tried running as administrator.

ValidateIdentifyWindow error: System.Windows.Markup.XamlParseException: 'Set 
property 'System.Windows.Forms.Integration.WindowsFormsHost.Child' threw an 
exception.' Line number '14' and line position '56'. ---> 
System.UnauthorizedAccessException: Access is denied. (Exception from 
HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, 
Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.WebBrowserBase.TransitionFromPassiveToLoaded()
at System.Windows.Forms.WebBrowserBase.TransitionUpTo(AXState state)
at System.Windows.Forms.WebBrowserBase.OnParentChanged(EventArgs e)
at System.Windows.Forms.Control.AssignParent(Control value)
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Integration.WinFormsAdapter.set_Child(Control value)
at System.Windows.Forms.Integration.WindowsFormsHost.set_Child(Control 
value)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, 
IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, 
IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, 
Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, 
Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel 
accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext 
parserContext, Object parent, Boolean closeStream)
...ValidateIdentifyWindow.InitializeComponent()
wpf
webbrowser-control
access-denied
asked on Stack Overflow Sep 7, 2018 by pp99

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0