4

When we are creating new webparts when is it that we have to add safe controls to package or web.config. I am confused on this topic.. Pls guide.

1) Where does the webpart (farm solution) go when target is set to: a) GAC and b) WebAPplication?

2)Where does the webpart (sandbox solution) go?

3) Where do custom aspx pages go when deployed as farm solution?

4) Where do custom aspx pages go when deployed as sandbox solution?

4
  • WebPart (Farm Solution)
    • GAC - DLLS placed in GAC, file level folders placed in the hive
    • WebApplication- DLLS placed in BIN folder of the web app, file level folders placed in the hive
  • WebPart (Sandbox)
    • GAC - DLLS placed in UCCache, content stored in the web app database
    • WebApplication -N/A

No, you only have to add third party libraries to the SafeControls if they do not already exist in the GAC or WebApplication bin folder. If the WebPart is to run Sandboxed select GAC - the DLL wont actually be placed in the GAC it will go into the UCCache.

4

When we are creating new webparts when is it that we have to add safe controls to package or web.config. I am confused on this topic.. Pls guide.

When you develop a new web part using Visual Studio 2010 or it later versions (Farm solution), it will create a WSP which is deployable to specific web application and a safe control entry is automatically added at the time of WSP deployment. Thanks to automatically generated solution manifest, Visual Studio will take care of packaging for Web Parts and their specific safe control entries.

1) Where does the webpart (farm solution) go when target is set to: a) GAC and b) WebAPplication? 2)Where does the webpart (sandbox solution) go?

When you deploy a Farm solution (containing a Web Part), safe control entries are added to the Web.config of web application automatically. Assembly will end-up either in the GAC or BIN of Web Application. You can choose to deploy it either to GAC or Bin, depending upon security policies of your SharePoint Farm.

When you deploy a Sandboxed solution (containing a Web Part), assemblies are not deployed to the global assembly cache instead to the Content databases and will be loaded via User code worker process. Moreover safe control will not added to the Web.config file but still be needing by Sandboxed solution service for verification of Web Parts type.

Sandboxed solutions are always activated/deployed at site collection level. You don't need the access to Central Admin (unlike Farm solutions) while deploying Sandboxed solutions . If a Sandboxed solutions is having Web Parts then those Web Parts will be provisioned at site collection level, in the Web Parts gallery.

3) Where do site pages go when deployed as farm solution? 4) Where do site pages go when deployed as sandbox solution?

It seems you're confused between site pages and page layouts? You never deploy the Site pages via Visual Studio instead they are created by SharePoint in the Content database. Although you deploy the Page layouts which are blueprint to the layout and metadata your site pages.

More information about Web Part development: http://msdn.microsoft.com/en-us/library/office/cc768621(v=office.14).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.