Quantcast
Viewing all articles
Browse latest Browse all 10096

Sandbox solution error: partial trust app domain

I have this wsp solution which i am trying to dynamically create a couple custom list. But whenever i do that, it will throw the partial trust app domain error. Does anyone know how I can get around that?

               // setup custom lists
                SPWeb oWeb = site.AllWebs[0];
                if (oWeb != null)
                {
                    try
                    {
                        SPList oTileList = oWeb.Lists["Tiles"];
                        if (oTileList == null)
                        {
                            oWeb.Lists.Add("Tiles", "A master list containing all the tiles showing on landing page", SPListTemplateType.GenericList);
                            SPList tileList = oWeb.Lists["Tiles"];
                            SPFieldUrl fldURLImage = (SPFieldUrl)tileList.Fields.CreateNewField(SPFieldType.URL.ToString(), "Cover");
                            fldURLImage.DisplayFormat = SPUrlFieldFormatType.Image;
                            tileList.Fields.CreateNewField(SPFieldType.URL.ToString(), "Url");
                            tileList.Update();
                        }

                        SPList oQuickLinksList = oWeb.Lists["QuickLinks"];
                        if (oQuickLinksList == null)
                        {
                            oWeb.Lists.Add("QuickLinks", "A master list containing all quicklinks showing on landing page right side column", SPListTemplateType.GenericList);
                            SPList QuickLinksList = oWeb.Lists["QuickLinks"];
                            QuickLinksList.Fields.CreateNewField(SPFieldType.URL.ToString(), "Url");
                            QuickLinksList.Update();
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }


Viewing all articles
Browse latest Browse all 10096

Trending Articles