Blog Home  Home RSS 2.0 Atom 1.0 CDF  
Pedro Serrano - «HRESULT: 0x80070005 (E_ACCESSDENIED)» when you try creating subwebs programmatically
Blog 'till you drop
 
 Thursday, October 25, 2007

You're getting «HRESULT: 0x80070005 (E_ACCESSDENIED)» when you try to create subwebs using a custom site definition programmatically?

For a quick work-around, just add this to your Assembly.info.cs file, re-compile and re-deploy:

using System.Security;

...

[assembly:AllowPartiallyTrustedCallers]

 

Signing and making your code trusted should also work, but if you're on a tight spot, this code will probably get you some air to breath :-D

Hope this helps someone out there ;-)

Copyright © 2008 Pedro Serrano. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: