Hello,
I have an other problem with SharePointPermission
I added the following simple code whitch triggers the list Associated Workflow:
SPSite site = new SPSite("http://intersticedev/hr");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Quitus"];
SPListItem item = list.Items.Add();
//
item.Update();
list.Update();
SPWorkflowManager wkfManager = item.Web.Site.WorkflowManager;
SPWorkflowAssociation myWkrAssociation = list.WorkflowAssociations[0];
wkfManager.StartWorkflow(item, myWkrAssociation, "", true);
//
This code snippet was tested on Windows Application on the server and it was successfully excuted.
When i created a WebPart and i inserted the same code for associated Workflow starting it generate the following exception:
Request for the permission of type :
'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.
the insertion of the ListItem is successful but the line of Workflow Starting cause problem.
notice that i have changed the WSS_Mini to WSS_Medium
please what's the problem ?
Best Regards.
Thanks !
Answers (1)
0
Hello,
Finally i found the solution.
When we use the Smartpart template it generate a non signed assembly and of course it's not deployed in the GAC, well we have the SharePoint permission set in the Minimal Trust config file and nevertheless the problem perssist.
it create the item on the list and it wont to launch the Workflow by code.
the solution is to sign and deploy the smartpart assembly template in the GAC.
Best regards.