This code works in console app but not in sandbox visual webpart built using vvs 2012,
ClientContext context = new ClientContext("http://www.SomeSite.com/sites/test1");
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
WebCreationInformation WCI = new WebCreationInformation();
WCI.Title = "Abc3";
WCI.Language = 1033;
WCI.UseSamePermissionsAsParentSite = true;
WCI.WebTemplate = GetCustomTemplate(web, context).Name;
WCI.Url = "abc3";
web.Webs.Add(WCI);
context.ExecuteQuery();
Console.WriteLine(web.Id);
I get security error on this line,
ClientContext context = new ClientContext("http://www.SomeSite.com/sites/test1");