Monday, May 30, 2011

SharePoint foundation: deploy a event handler for custom list

There are severals methods to deploy event handler in SharePoint:
(1) deploy through Visual Studio 2010
(2) deploy solutions through stsadm command

Link an event handler to a specific list
When you create an evnet handler, you cannot find any custom list name in event source.


You select Custom List and press button Finish. After the creation of event handler, you can double click the Elements.xml under EventReceiver1.


Then, you need to change the line from

       <Receivers ListTemplateId="104">

to

      <Receiver ListUrl="List/helloWorld">

 Now, the event handler is linked to the list helloWorld


Deploy the event handler through Visual Studio 2010




There is only one step you need to do: right click the solution and select Deploy. Then, Visual Studio 2010 will deploy and activate the solution automatically.

Deploy the event handler though stsadm

(1) add solution

(2) deploy solution
   
(3) activate the solution


     Go to Site Settings -> Manage site features and press button Activate for the solution


Reference: http://patrickboom.wordpress.com/2010/05/31/using-powershell-to-deploy-sharepoint-solutions-wsp-2/

SharePoint foundation: deploy a workflow in sharepoint

There are several steps needed to deploy workflow solutions manually by stsadm command.

1.  add a solution into SharePoint

 
2. deploy the solution into SharePoint


3. execute the time job


4. Go to Site Settings -> Site Collection Administration -> Site collection features and activate the feature


5. Go to Site Settings -> Site Administration -> Workflows, the status of the feature is active



Tuesday, May 10, 2011

Cannot edit DCOM Config properties

I get an error from my event handler which suggests me to modify  the {000C101C-0000-0000-C000-000000000046} using the Component Services administrative Tool.

1. Administrative Tools ->  Component Services -> {000C101C-0000-0000-C000-000000000046}
2. Right click the {000C101C-0000-0000-C000-000000000046} and then select properties
3. Go to security tab and I cannot edit the "Launch and Activation Permission" and "Access Permissions" ad the choices are grayed out

After another searching, I know that I need to do something in Register Editor

1.  In cmd, type "regedit"
2. Go to HK_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{000C101C-0000-0000-C000-000000000046}
3. Right click it and select permission and then click Adanced
4. Go to Owner tab and update Administrators ad the current Owner


5. Grant the administrators "Full Control"

6. Restart the Component Services

7. You can modify the Permissions now

Monday, May 2, 2011

Event Handler: The object cannot be created from sandboxed code assembly

I create an solution of event handler whose name is "eventHandler-v1.0" and then bind the event handler to a list in SharePoint.

When I start debugging the solution in Visual Studio 2010, an error message is shown as below
"Error creating instance of sandboxed code object. The object cannot be created from sandboxed code assembly."


I suspect the problem comes from the name of my solution which contains '.', so  I try to create a solution whose name without '.' and everything works fine.