Step Bi Step
Posts Tagged Form Options
Request for the permission of type ‘System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ failed – InfoPath 2007 forms Security Levels
Posted by Rajanihanth in .Net, InfoPath 2007, InfoPath 2010 on July 18, 2012
When I was trying to display user information from Active Directory(AD) in an InfoPath form, I have got an error message saying that I don’t have permissions to access the Directory services. 😦
Details of the error message:
Text format of the error:
System.Security.SecurityException Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed. at Template2.FormCode.GetOU(String username) at Template2.FormCode.CTRL1_5_Clicked(Object sender, ClickedEventArgs e) at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent) at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
I have faced this kind of security level errors while creating a web parts using Active Directory(AD) and you can read this in my previous post.
Basically InfoPath provides three security levels for forms, they are:
- Restricted
- Domain
- Full Trust
The security levels determine whether a form can access data on other domains, or access files and settings on a user’s computer. If you need more info about this, just click here.
When we design/create an InfoPath form, the minimum trust level will be assigned in-default and which is not enough to access the Directory Services. So we need to change the trust level to access the information. These are the simple steps to change the Trust Levels in InfoPath,
Step 1: Open the Form template in Design Mode
Step 2: Click the Form Options on the Tools menu
Step 3: You will be getting the following window and the security levels automatically determined
Step 4: Unchecked the check box, give the permissions to ‘Full Trust’ and then click OK
That’s all, you can access the Directory Services programmatically and display in your InfoPath form. Sometimes you will be getting another error after fixing this (probably after publishing to SharePoint), to solve this problem we just need to specify the digitally signed certificate for this form. Check out the error message here.
Thanks. R./
Active Directory, AD, digitally signed certificate, Directory services, DirectoryServicesPermission, Form Options, Full Trust, InfoPath 2007
Recent Posts
- TF255507: The security identifier (SID) for the following SQL Server login conflicts with a specified domain or workgroup account
- Installing Visual Studio Team Foundation Server 2010-Basic Configuration Step By Step
- The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.
- 2012 in Review!
- Getting started with Windows 8 Metro Style Application using C# – Visual Studio 2012
Categories
- .Net (23)
- Active Directory (4)
- ASP.Net (1)
- BDC (5)
- C# (5)
- Client Object model (3)
- Crystal Reports (1)
- DirectoryServices (3)
- Excel Services (3)
- GAC (1)
- InfoPath 2007 (5)
- InfoPath 2010 (4)
- MetaData (1)
- SharePoint 2007 (19)
- SharePoint 2010 (10)
- Silverlight (2)
- SQL Server (9)
- SSRS (3)
- STSADM (2)
- Tech Tips-.Net (4)
- Tech Tips-SharePoint (1)
- Tech Tips-SQL (2)
- TFS (3)
- TFS 2010 (3)
- TFS 2012 (1)
- Uncategorized (1)
- VB.Net (1)
- Versus (vs) (2)
- Visual Studio 2012 (3)
- VSTA (3)
- Webpart (8)
- Windows 8 (3)
- WSP Builder (4)
- XAML (1)
Certifications
Labels
.Net Active Directory BDC C# Client Object model Crystal Reports DirectoryServices Excel Services GAC InfoPath 2007 InfoPath 2010 MetaData SharePoint 2007 SharePoint 2010 Silverlight SQL Server SSRS STSADM Tech Tips-.Net Tech Tips-SharePoint Tech Tips-SQL TFS TFS 2010 Uncategorized Versus (vs) Visual Studio 2012 VSTA Webpart Windows 8 WSP BuilderCalendar
June 2023 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30