Could not load type ‘Microsoft.ContentManagement. WebAuthor.PostingProperties’
23 October 09 10:04 PM

sometimes you  deploy a new CMS 2002 site and you will see above error message or “could not load type” for CMS pages. It means that page is trying to load find the class but it doesn’t exist. So best tool to troubleshoot this type of issue is Assembly Binding Log Viewer (Fuslogvw.exe). You can run this tool and request the culprit page in the browser it will let you know that what are assemblies requested and what is the result of the call.

In my case, it told me that page was not calling for Microsoft.ContentManagement. WebAuthor.dll” . So I tried to find out whether this assembly was added in the web.config.

image

 

Here is the code snippet which requires to be add in the web.config file :-

   1: <add assembly="Microsoft.ContentManagement.Common, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   2:         <add assembly="Microsoft.ContentManagement.Publishing, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   3:         <add assembly="Microsoft.ContentManagement.Publishing.Extensions.Placeholders, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   4:         <add assembly="Microsoft.ContentManagement.Publishing.Extensions.Placeholders.Office, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   5:         <add assembly="Microsoft.ContentManagement.Web, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   6:         <add assembly="Microsoft.ContentManagement.WebAuthor, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   7:         <add assembly="Microsoft.ContentManagement.WebControls, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Postedby Navdeep Madan | 0 Comments    
Unable to sort the BDC column which contain space
22 October 09 12:58 PM

Let me explain you with an example, If you have table like described below and you would like to show the “Name” field as “First Name”. 

Table Name :- employee_test

Table description
ID         NUMBER
NAME        VARCHAR2(20)
LOCATION     VARCAHR2(20)
AGE        NUMBER

Create the view using the following SQL command

Create view view_employee as SELECT ID, NAME AS "FIRST NAME", LOCATION, AGE FROM EMPLOYEE_Test

Generally  you create a application definition file view_employee.xml and add the Type descriptor like this ;-

<TypeDescriptor TypeName="System.String" Name="FIRST NAME" />

and now if you try to sort the Business Data List web part , you won’t get the correct result. To resolve this use the following SQL command :-

create view view_employee as SELECT ID, NAME , LOCATION, AGE FROM EMPLOYEE_Test

Change the type descriptor for your localized version (In my example I changed for English-Us so the LCID is 1033) in the application definition file. I fetched the Name without using the space but changed it for the display purposes.

<TypeDescriptor TypeName="System.String" Name="NAME">
<LocalizedDisplayNames>
            <LocalizedDisplayName LCID="1033">FIRST  NAME </LocalizedDisplayName>
      </LocalizedDisplayNames>
</TypeDescriptor>

Postedby Navdeep Madan | 0 Comments    
How to login in SharePoint FBA site from another ASP.NET Site ?
21 October 09 03:15 PM

If you would like to jump between your ASP.NET site and SharePoint FBA site and don’t want to login again, then you ASP.NET site must contain same viewstate and Event validation of your FBA site .

   1: <form name="Form1" method="post" action="http://localhost:1643/CommonAutheticationCookie/NTLMLogIn.aspx?ReturnUrl=%2fCommonAutheticationCookie%2fdefault.aspx" id="Form1">
   2: <div>
   3: <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTIyOTQ2NTA3MmRk3x68MhAJJka37xjE++p7nmfpDUg=" />
   4: </div>
   5:  
   6:     
   7:     <HR width="100%" SIZE="1">
   8:     <DIV style="DISPLAY: inline; WIDTH: 464px; HEIGHT: 32px" ms_positioning="FlowLayout"
   9:      id="lblStatus">Please Enter your User name and password!</DIV>
  10:        <P>Domain Name :
  11:                     <input name="txtDomainName" type="text" id="txtDomainName" value="ANOMALY" />
  12:                     <br />
  13:                 User Name:
  14:     <input name="txtUserName" type="text" id="txtUserName" value="nm" />
  15:     <BR>
  16:     Password:
  17:     <input name="txtPassword" type="text" id="txtPassword" value="pass2word!"/>
  18:     </P>
  19:    <P>
  20:     <input type="submit" name="butLogIn" value="Log In" id="butLogIn" />&nbsp;
  21:     <!--  -->&nbsp;
  22:     <input type="submit" name="butClear" value="Clear" id="butClear" /></P>
  23:                 <P>
  24:         <span id="lblError"></span>
  25:                 &nbsp;</P>
  26:   
  27: <div>
  28:  
  29:  <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBgLMq6vVCAL9sO3VBgKl1bKzCQK1qbSRCwKUyOuxAQKfpfP1BBYQ7kXGVTMkWa1q0NVVdYFVrV2p" />
  30: </div></form>
Postedby Navdeep Madan | 0 Comments    
How to crawl the content of file with the extension “.cs (C-Sharp)”?
21 October 09 09:09 AM

C-Sharp is not a special file it can be read as a text  file. So crawling to this file you won’t require to add the special filter and you can use the same IFilter which used to crawl the text files ({4A3DD7AB-0A6B-43B0-8A90-0D8B0CC36AAB}). But the problem you will face in providing the MimeTypes for this extension. Behind the scene, protocol handler call the IFilter based upon the file MimeTypes, you can provide any text MimeType to call cs IFilter but the MimeTypes should be different from “text/plain”.I used the text/scriptlet”.

1. Add the filter-extension to the File types crawled:

Start -> Program -> Microsoft Office Server -> SharePoint 3.0 Central Administration -> <Name of SharedService Provider> -> Search Settings -> File Types -> New File Type (Add extension here)

File-Extension

2. Add the following registry keys:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0 \Search\Applications\<Site>\Gather\Portal_Content\Extensions\ExtensionList]

<add extension to the list>

 

image

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\Filters\.ext]

Default = (value not set)

Extension = <ext>

FileTypeBucket REG_DWORD = 0x00000001 (1)

MimeTypes = <application>

 

image

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office

Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.ext]

Default REG_MULTI_SZ = IFIlter CLASSID

image

3. Finally, recycle the Search Service by executing the following command from the command window:

net stop osearch

net start osearch

image

Note :- The content source should be network share. If you crawl the content from a document library you will face the “Content for this URL is excluded by the server because a no-index attribute.” warning at the time of crawling the content.

http://blogs.msdn.com/ifilter/archive/2006/11/20/registering-third-party-ifilters-in-wss-moss-2007.aspx

http://support.microsoft.com/default.aspx?scid=kb;en-us;970113&sd=rss&spid=12200

Postedby Navdeep Madan | 0 Comments    
SharePoint 2010 Developer documentation
20 October 09 04:28 PM

Hey Guys,

Good News !!!

SharePoint Developer documentation in live on MSDN . Please click on SharePoint 2010 Developer Documentation Now Live on MSDN and read about he SharePoint 2010.

Thanks,

Navdeep Madan

Postedby Navdeep Madan | 0 Comments    
You don’t want new instances of your workflow association, so here is the code snippet & it’s API description.
19 October 09 08:40 PM

You have installed the new version of a workflow and you don’t want to create the instances of previous association or because of other reasons you don’t want to end users to create new instances of workflow ( Workflow Association). You can remove workflow from UI through UI by selecting “Remove Workflows” under “settings” . Here is the screen shot :-

 image

But if you would like to achieve the SharePoint Object Model then “SPworkflowAssosiation” instance contain the running workflow values in SharePoint. Firstly, you have to traverse the list’s workflow associations and keep SPworkflowAssosiation in SPWorkflowAssosiation array after setting the enabled property of object false. Update the list in separate for loop.

   1: using System;
   2: using System.Collections.Generic;
   3: using System.Linq;
   4: using System.Text;
   5: using Microsoft.SharePoint;
   6: using Microsoft.SharePoint.Workflow;
   7:  
   8: namespace WorkflowAssosiation
   9: {
  10:     class Program
  11:     {
  12:         static void Main(string[] args)
  13:         {
  14:  
  15:             using (SPSite site = new SPSite("http://blre3r15-5:3000/sites/TestSite"))
  16:             {
  17:                 using (SPWeb web = site.RootWeb)
  18:                 {
  19:                     SPListCollection lists = web.Lists;
  20:                     SPWorkflowAssociation[] myUpdate = new  SPWorkflowAssociation[15];;
  21:                     int cwaUpdate = 0;
  22:                     string ListId = string.Empty;
  23:                     foreach (SPList list in lists)
  24:                     {
  25:                         SPWorkflowAssociationCollection collection = list.WorkflowAssociations;
  26:                         foreach (SPWorkflowAssociation assosiation in collection)
  27:                         {
  28:                                                
  29:                             //SPWorkflowAssociation assosiation = collection.GetAssociationByBaseID(guid);
  30:                             if (assosiation != null)
  31:                             {
  32:                                 
  33:                                 Console.WriteLine(assosiation.Enabled.ToString());
  34:                                 
  35:                                 assosiation.Enabled = false;
  36:                                 myUpdate[cwaUpdate++] = assosiation;
  37:                                 Console.WriteLine(assosiation.Enabled.ToString());
  38:                                 ListId = list.ID.ToString();
  39:                             }
  40:                             }
  41:                         
  42:                     }
  43:                     if (ListId != null || ListId == string.Empty)
  44:                     {
  45:                         System.Guid guid2 = new Guid(ListId);
  46:                         SPList newList = web.Lists[guid2];
  47:                         for (int i = 0; i < cwaUpdate; i++)
  48:                         {
  49:                             newList.UpdateWorkflowAssociation(myUpdate[i]);
  50:                         }
  51:                     }
  52:                 }
  53:                 Console.WriteLine("Press any key to continue....");
  54:                 Console.Read();
  55:             }
  56:           
  57:         }
  58:     }
  59: }
Postedby Navdeep Madan | 0 Comments    
How to add the help link in Top link bar ?
20 September 09 03:57 AM

Help is the very important for the end user in SharePoint site.  Some time they will not find the helpicon icon on the top of the page.  To make it easily available , you can add “Top link bar “.

1) Go to “Site Actions –> Site Settings” and click on the “top link bar” and type the following JavaScript.

HelpJavaScript

 

HelpResult

2) Go to “Site Actions –> Site Settings” and click on the “top link bar” and type the following URL.

HelpLayouts

Postedby Navdeep Madan | 0 Comments    
How to delete old versions of a document from a document library?
19 September 09 09:56 AM
Create a console application and add the reference if Microsoft.SharePoint .
Add the web reference of version’s (http://MossSite/_vti_bin/versions.asmx) web service.
 
   1: //Change the SPSite URL.
   2:            using (SPSite site = new SPSite(http://MossSite/sites/SiteCollection))
   3:            {
   4:                using (SPWeb web = site.OpenWeb())
   5:                {
   6:                    //Change the Document Library Name.
   7:                    SPDocumentLibrary library = (SPDocumentLibrary)web.Lists["MATTDOCLibrary"];
   8:                    foreach (SPListItem item in library.Items)
   9:                    {
  10:                        Console.WriteLine(item.Name);
  11:                        Console.WriteLine("====== BEFORE DELETION =====\n\n");
  12:                        SPFile file = (SPFile)item.File;
  13:                        int counter = item.Versions.Count;
  14:                        Console.WriteLine("counter :- " + counter);
  15:                        VersionService.Versions objVersion = new VersionService.Versions();
  16:                        objVersion.Credentials = System.Net.CredentialCache.DefaultCredentials;
  17:                        System.Xml.XmlNode ndVersion = objVersion.DeleteAllVersions(item.File.ToString());
  18:                    }
  19:                    library.Update();
  20:                    web.Update();
  21:                    foreach (SPListItem item in library.Items)
  22:                    {
  23:                        Console.WriteLine("\n" + item.DisplayName);
  24:                        Console.WriteLine("======AFTER DELETION =====\n\n");
  25:                        foreach (SPListItemVersion subitem in item.Versions)
  26:                        {
  27:                            Console.WriteLine("Version ID : " + subitem.VersionLabel.ToString());
  28:                        }
  29:                    }
  30:                }
  31:            }
Postedby Navdeep Madan | 1 Comments    
Switch to Edit Site doesn’t work in MCMS 2002
19 September 09 09:32 AM

When you click Switch to Edit Site on a published posting in Microsoft Content Management Server (MCMS) 2002 to create content, the page got refreshed, but the page does not switch to edit mode from live mode. Also the Web Author console does not display.

This problem may occur because of customization of IIS_CMS folder. MCMS 2002 SP2 patch upgrade this folder and files contain in it. Because of the customization Web Authoring console does not display.

To resolve this problem, clear the Internet Explorer file cache and follow these steps:

1. Click Start, got to RUN prompt, and then type “Inetmgr”.

2. Expand your CMS (Example WoodgrooveInternational) site, Right click to CMS site virtual Directory. Go to properties

3. Check the value of “Local path:”, if it contains the value apart from “C:\Program Files\Microsoft Content Management Server\Server\IIS_CMS” then please change it back to this value.

4. Browse the site, now you switch to Edit once again.

NOTE: - If you would like bring back your customization then create new folder and copy the upgraded folder. Manually do the customization once again.

Postedby Navdeep Madan | 0 Comments    
Add domain user to all sites and sub-sites as secondary administrator
19 September 09 09:18 AM

If you have to add a site collection administrator, then first option is through user interface. Go to Central Administration site and Click on the “Application Management” tab. Click an option “Site collection administrator” under the “SharePoint Site Management” tab.

SharePointSiteManagement

 

You will get redirect to “Site Collection Administrators Page :-

SiteCollectionAdministrator

 

go ahead and add your domain user as a secondary administrator.

 

Second option is through Stsadm utility. Here is the command you have to run :-

AddSecondaryOwner

and go and refresh the Site Collection administrator Page.

Result

 

But if you have to add the secondary administrator for all the site and sub-sites .  Here is the code snippet :-

   1: using System;
   2: using System.Collections.Generic;
   3: using System.Text;
   4: using Microsoft.SharePoint;
   5: using Microsoft.SharePoint.Administration;
   6: using System.Diagnostics;
   7:  
   8: namespace AddAdministrator
   9: {
  10:     class Program
  11:     {
  12:         static void Main(string[] args)
  13:         {
  14:             try
  15:             {
  16:                 SPWebApplicationCollection webApplications = null;
  17:                 webApplications = SPWebService.ContentService.WebApplications;
  18:  
  19:                 foreach (SPWebApplication application in webApplications)
  20:                 {
  21:                     Console.WriteLine("Application Pool Identity ");
  22:                     SPApplicationPool appPool = application.ApplicationPool;
  23:                     Console.WriteLine("Application Pool Name :- " + appPool.Name + " Application Pool  UserName " + appPool.Username + "Application pool Password " + appPool.Password);
  24:                     if (!application.IsAdministrationWebApplication)
  25:                     {
  26:                         Console.WriteLine("Application Name " + application.Name);
  27:                         SPSiteCollection sites = application.Sites;
  28:                         for (int i = 0; i < sites.Count; i++)
  29:                         {
  30:                             
  31:                             using (SPSite site = sites[i])
  32:                             {
  33:                                 Console.WriteLine("Site URL " + site.Url);
  34:                                 
  35:                                 // Uncomment this code if you would like to add a seconday administrator.
  36:                                 
  37:                                 /*Program obj = new Program();
  38:                                 obj.stsadmCommand("-o siteowner -url " + site.Url.ToString() + " -secondarylogin " + "NAVD1533981\\vishalm");
  39:                                 Console.WriteLine("Secondar Administrator Added");*/
  40:  
  41:                                 foreach (SPWeb web in site.AllWebs)
  42:                                 {
  43:                                     Console.WriteLine("Web URL " + web.Url);
  44:                                     
  45:                                     SPGroupCollection groupCollection = web.SiteGroups;
  46:                                     SPUser adminUser = web.SiteAdministrators.GetByEmail("vishalm@microsoft.com");
  47:                                     if (adminUser == null)
  48:                                     {
  49:                                         web.SiteAdministrators.Add("NAVD1533981\\vishalm", "vishalm@microsoft.com", "Vishal Madan", "A administrator has been added.");
  50:                                     }
  51:  
  52:                                     SPUser user = web.SiteAdministrators.GetByEmail("vishalm@microsoft.com");
  53:                                     if (web.IsRootWeb)
  54:                                     {
  55:                                         SPUserCollection userCollection = web.SiteAdministrators;
  56:                                         bool userIsAdmin = false;
  57:                                         foreach (SPUser spUser in userCollection)
  58:                                         {
  59:                                             if (spUser.ID == user.ID)
  60:                                             {
  61:                                                 userIsAdmin = true;
  62:                                                 break;
  63:                                             }
  64:                                         }
  65:                                         if (userIsAdmin == false)
  66:                                         {
  67:                                             user.IsSiteAdmin = true;
  68:                                             user.Update();
  69:                                         }
  70:                                     }
  71:  
  72:                                     web.Update();
  73:                                     web.Dispose();
  74:                                 }
  75:                              
  76:                             }
  77:                         }
  78:                     }
  79:                 }
  80:           
  81:             }
  82:             catch (NullReferenceException)
  83:             {
  84:                 Console.WriteLine("Cannot access web applications.");
  85:                 
  86:             }
  87:             catch (Exception exception)
  88:             {
  89:                 Console.WriteLine("Error occurred: " + exception.Message);
  90:                 Console.WriteLine("See the application event log for more information.");
  91:             }
  92:  
  93:             Console.ReadKey();
  94:         }
  95:         StringBuilder sortOutput = null;
  96:         private string stsadmCommand(string Arguments)
  97:         {
  98:             string stsadmPath = @"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE";
  99:  
 100:             System.Diagnostics.Process sortProcess = new System.Diagnostics.Process();
 101:             sortProcess.StartInfo.FileName = stsadmPath;
 102:             sortProcess.StartInfo.CreateNoWindow = true;
 103:             sortProcess.StartInfo.Arguments = Arguments;
 104:             sortProcess.StartInfo.UseShellExecute = false;
 105:             sortProcess.StartInfo.RedirectStandardOutput = true;
 106:             sortOutput = new StringBuilder("");
 107:             sortProcess.OutputDataReceived += new DataReceivedEventHandler(SortOutputHandler);
 108:             sortProcess.StartInfo.RedirectStandardInput = true;
 109:             sortProcess.Start();
 110:             sortProcess.BeginOutputReadLine();
 111:             sortProcess.WaitForExit();
 112:             sortProcess.Close();
 113:             return sortOutput.ToString();
 114:         }
 115:  
 116:         private void SortOutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
 117:         {
 118:             // Add the text to the collected output.
 119:             sortOutput.Append(outLine.Data);
 120:         }
 121:     
 122:     }
 123: }


  
Postedby Navdeep Madan | 0 Comments    
Code Access Security in SharePoint
19 September 09 12:11 AM

Code access security is a mechanism to limit the access of the code to protect the resources and operations. In SharePoint you can have the two level i.e “WSS_Medium” and “WSS_Minimal”.

   1: <securityPolicy>
   2:      <trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_mediumtrust.config" />
   3:      <trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_minimaltrust.config" />
   4:    </securityPolicy>

By default in SharePoint, you have the “WSS_Minimal”, in web.config file.

   1: <trust level="WSS_Minimal" originUrl="" />

If don’t want to provide your assembly “Full” trust because it will get the full access to your resources.
1) Check the required permission using Permission Calculator Tool (Permcalc.exe)
2) Design the custom policy file [Microsoft Windows SharePoint Services and Code Access Security].SharePoint has provided two security permission class :-
    1) Microsoft.SharePoint.Security.SharePointPermission
     2) Microsoft.SharePoint.Security.WebPartPermission
3) Copied at “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\CONFIG\wss_custom_wss_minimaltrust.config”.

 
   1: <configuration>
   2:   <mscorlib>
   3:     <security>
   4:       <policy>
   5:         <PolicyLevel version="1">
   6:           <SecurityClasses>
   7:               <SecurityClass Name="AllMembershipCondition" Description="System.Security.Policy.AllMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
   8:               <SecurityClass Name="AspNetHostingPermission" Description="System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
   9:               <SecurityClass Name="ConfigurationPermission" Description="System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  10:               <SecurityClass Name="DnsPermission" Description="System.Net.DnsPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  11:               <SecurityClass Name="EnvironmentPermission" Description="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  12:               <SecurityClass Name="FileIOPermission" Description="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  13:               <SecurityClass Name="FirstMatchCodeGroup" Description="System.Security.Policy.FirstMatchCodeGroup, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  14:               <SecurityClass Name="IsolatedStorageFilePermission" Description="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  15:               <SecurityClass Name="NamedPermissionSet" Description="System.Security.NamedPermissionSet"/>
  16:               <SecurityClass Name="PrintingPermission" Description="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  17:               <SecurityClass Name="ReflectionPermission" Description="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  18:               <SecurityClass Name="RegistryPermission" Description="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  19:               <SecurityClass Name="SecurityPermission" Description="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  20:               <SecurityClass Name="SmtpPermission" Description="System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  21:               <SecurityClass Name="SocketPermission" Description="System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  22:               <SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  23:               <SecurityClass Name="StrongNameMembershipCondition" Description="System.Security.Policy.StrongNameMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  24:               <SecurityClass Name="UnionCodeGroup" Description="System.Security.Policy.UnionCodeGroup, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  25:               <SecurityClass Name="UrlMembershipCondition" Description="System.Security.Policy.UrlMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  26:               <SecurityClass Name="WebPermission" Description="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  27:               <SecurityClass Name="ZoneMembershipCondition" Description="System.Security.Policy.ZoneMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  28:               <SecurityClass Name="SharePointPermission" Description="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
  29:               <SecurityClass Name="WebPartPermission" Description="Microsoft.SharePoint.Security.WebPartPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
  30:           </SecurityClasses>
  31:           <NamedPermissionSets>
  32:             <PermissionSet class="NamedPermissionSet" version="1" Description="Permissions for IBM FileNet Web Parts" Name="fnspwebparts.wsp-ab39a08f-52d9-49c7-a608-f797f52fafb6-1" >
  33:                 <IPermission class="EnvironmentPermission"
  34: version="1"
  35: Unrestricted="true"/>
  36:                 <IPermission class="FileDialogPermission"
  37:                 version="1"
  38:                 Unrestricted="true"/>
  39:                 <IPermission class="FileIOPermission"
  40:                 version="1"
  41:                 Unrestricted="true"/>
  42:                 <IPermission class="IsolatedStorageFilePermission"
  43:                 version="1"
  44:                 Unrestricted="true"/>
  45:                 <IPermission class="ReflectionPermission"
  46:                 version="1"
  47:                 Unrestricted="true"/>
  48:                 <IPermission class="RegistryPermission"
  49:                 version="1"
  50:                 Unrestricted="true"/>
  51:                 <IPermission class="SecurityPermission"
  52:                 version="1"
  53:                 Unrestricted="true"/>
  54:                 <IPermission class="UIPermission"
  55:                 version="1"
  56:                 Unrestricted="true"/>
  57:                 <IPermission class="KeyContainerPermission"
  58:                 version="1"
  59:                 Unrestricted="true"/>
  60:                 <IPermission class="DnsPermission"
  61:                 version="1"
  62:                 Unrestricted="true"/>
  63:                 <IPermission class="PrintingPermission"
  64:                 version="1"
  65:                 Unrestricted="true"/>
  66:                 <IPermission class="SocketPermission"
  67:                 version="1"
  68:                 Unrestricted="true"/>
  69:                 <IPermission class="WebPermission"
  70:                 version="1"
  71:                 Unrestricted="true"/>
  72:                 <IPermission class="EventLogPermission"
  73:                 version="1"
  74:                 Unrestricted="true"/>
  75:                 <IPermission class="StorePermission"
  76:                 version="1"
  77:                 Unrestricted="true"/>
  78:                 <IPermission class="PerformanceCounterPermission"
  79:                 version="1"
  80:                 Unrestricted="true"/>
  81:                 <IPermission class="OleDbPermission"
  82:                 version="1"
  83:                 Unrestricted="true"/>
  84:                 <IPermission class="SqlClientPermission"
  85:                 version="1"
  86:                 Unrestricted="true"/>
  87:                 <IPermission class="DataProtectionPermission"
  88:                 version="1"
  89:                 Unrestricted="true"/>
  90:                 <IPermission
  91:                           class="AspNetHostingPermission"
  92:                           version="1"
  93:                           Level="Medium"
  94:                             />
  95:                 <IPermission
  96:                           class="DnsPermission"
  97:                           version="1"
  98:                           Unrestricted="True"
  99:                             />
 100:                 <IPermission class="WebPartPermission"
 101:                          version="1"
 102:                          Connections="True"
 103:                           Unrestricted="True"  />
 104:                 <IPermission class="SharePointPermission"
 105:              version="1"
 106:              ObjectModel="True" Unrestricted="True" />
 107:  
 108:             </PermissionSet>
 109:             <PermissionSet class="NamedPermissionSet" 
 110:                            version="1" 
 111:                            Unrestricted="true" 
 112:                            Name="FullTrust" 
 113:                            Description="Allows full access to all resources" />
 114:               
 115:             <PermissionSet class="NamedPermissionSet" version="1" Name="Nothing" Description="Denies all resources, including the right to execute" />
 116:               <PermissionSet
 117:                                  class="NamedPermissionSet"
 118:                                  version="1"
 119:                                  Name="SPRestricted">
 120:                   <IPermission
 121:                           class="AspNetHostingPermission"
 122:                           version="1"
 123:                           Level="Medium"
 124:                             />
 125:                   <IPermission
 126:                           class="DnsPermission"
 127:                           version="1"
 128:                           Unrestricted="true"
 129:                             />
 130:                   <IPermission
 131:                           class="EnvironmentPermission"
 132:                           version="1"
 133:                           Read="TEMP;TMP;USERNAME;OS;COMPUTERNAME"
 134:                             />
 135:                   <IPermission
 136:                           class="FileIOPermission"
 137:                           version="1"
 138:                           Read="$AppDir$"
 139:                           Write="$AppDir$"
 140:                           Append="$AppDir$"
 141:                           PathDiscovery="$AppDir$"
 142:                             />
 143:                   <IPermission
 144:                           class="IsolatedStorageFilePermission"
 145:                           version="1"
 146:                           Allowed="AssemblyIsolationByUser"
 147:                           UserQuota="9223372036854775807"
 148:                             />
 149:                   <IPermission
 150:                           class="PrintingPermission"
 151:                           version="1"
 152:                           Level="DefaultPrinting"
 153:                             />
 154:                   <IPermission
 155:                           class="SecurityPermission"
 156:                           version="1"
 157:                           Flags="Assertion, Execution, ControlThread, ControlPrincipal, RemotingConfiguration"
 158:                             />
 159:                   <IPermission class="SharePointPermission"
 160:                           version="1"
 161:                           ObjectModel="True"
 162:                             />
 163:                   <IPermission
 164:                           class="SmtpPermission"
 165:                           version="1"
 166:                           Access="Connect"
 167:                             />
 168:                   <IPermission
 169:                           class="SqlClientPermission"
 170:                           version="1"
 171:                           Unrestricted="true"
 172:                             />
 173:                   <IPermission class="WebPartPermission"
 174:                           version="1"
 175:                           Connections="True"
 176:                             />
 177:                   <IPermission
 178:                           class="WebPermission"
 179:                           version="1">
 180:                       <ConnectAccess>
 181:                           <URI uri="$OriginHost$"/>
 182:                       </ConnectAccess>
 183:                   </IPermission>
 184:               </PermissionSet>
 185:           </NamedPermissionSets>
 186:           <CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Nothing">
 187:             <IMembershipCondition class="AllMembershipCondition" version="1" />
 188:             <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="fnspwebparts.wsp-ab39a08f-52d9-49c7-a608-f797f52fafb6-1">
 189:               <IMembershipCondition version="1" class="StrongNameMembershipCondition" PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001009f190b7fe605e7f7ed48417c133425cdd523804bb7c3a7dc12f7dc97ebc1fc804a54d14e30a647e8341b32afcd08adb85d9c23df869bc50ab0d77c8dcbbd4db760f0b6fa69eb2ec6e615d37bfcc2e661e750f378a757de3bbf1cdf6b22ddf4e1a62dae6d2d45d3e2213cc04d65ae7a1f4746fed02248293265be01f7d43dd7c5"/>
 190:             </CodeGroup>
 191:             <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust">
 192:               <IMembershipCondition class="UrlMembershipCondition" version="1" Url="$AppDirUrl$/_app_bin/*" />
 193:             </CodeGroup>
 194:             <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="SPRestricted">
 195:               <IMembershipCondition class="UrlMembershipCondition" version="1" Url="$AppDirUrl$/*" />
 196:             </CodeGroup>
 197:             <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust">
 198:               <IMembershipCondition class="UrlMembershipCondition" version="1" Url="$CodeGen$/*" />
 199:             </CodeGroup>
 200:             <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="Nothing">
 201:               <IMembershipCondition class="ZoneMembershipCondition" version="1" Zone="MyComputer" />
 202:               <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Microsoft_Strong_Name" Description="This code group grants code signed with the Microsoft strong name full trust. ">
 203:                 <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293" />
 204:               </CodeGroup>
 205:               <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Ecma_Strong_Name" Description="This code group grants code signed with the ECMA strong name full trust. ">
 206:                 <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="00000000000000000400000000000000" />
 207:               </CodeGroup>
 208:             </CodeGroup>
 209:           </CodeGroup>
 210:         </PolicyLevel>
 211:       </policy>
 212:     </security>
 213:   </mscorlib>
 214: </configuration>

Here is the glimpse of type of permission which may help to design the file:-

<IPermissionclass="EnvironmentPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="FileDialogPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="FileIOPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="IsolatedStorageFilePermission"version="1"Unrestricted="true"/>
<
IPermissionclass="ReflectionPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="RegistryPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="SecurityPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="UIPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="KeyContainerPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="DnsPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="PrintingPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="SocketPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="WebPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="EventLogPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="StorePermission"version="1"Unrestricted="true"/>
<
IPermissionclass="PerformanceCounterPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="OleDbPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="SqlClientPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="DataProtectionPermission"version="1"Unrestricted="true"/>
<
IPermissionclass="AspNetHostingPermission"version="1"Level="Medium" />
<
IPermissionclass="DnsPermission"version="1"Unrestricted="True" />
<
IPermissionclass="WebPartPermission"version="1"Connections="True"Unrestricted="True" />
<
IPermissionclass="SharePointPermission"version="1"ObjectModel="True"Unrestricted="True" />

And articles:-

1) How to demand permissions by using Code Access Security
2) ASP.NET Code Access Security


4) You have to modify you web.config file and its looks like this:-

   1: <securityPolicy>
   2:       <trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_mediumtrust.config" />
   3:       <trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_minimaltrust.config" />
   4:       <trustLevel name="WSS_Custom" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_custom_wss_minimaltrust.config" />
   5:     </securityPolicy>

 

5) Modify the trust’s level attribute  with you custom trust level name.

   1: <trust level="WSS_Custom" originUrl="" />

Postedby Navdeep Madan | 0 Comments    
How to do hang dump analysis?
18 September 09 12:43 AM

One of my customers facing an interesting issue. He has created a CMS site which slows down after 4 or 5 days. After doing the complete scoping I found that one of the page take 2-3 minutes to load and he has following work-around to temporarily fix the issue.

1) DO an IISREST.

2) Delete the application-pool and recreated it again.

I took the hand dump using the Ad-Plus [Download] script . This support article talk more about this tool  http://support.microsoft.com/kb/286350

Start a command window and browse to your debuggers directory. 

adplus –hang –pn w3wp.exe

please attach the correct process id.

Open the dump in Windbg.exe

1) Open windbg and open the memory dump (.dmp file) with File/Open Crash dump.

2) Set up the symbol path :-

SRV*c:\symbols*http://msdl.microsoft.com/download/symbols

3) Load sos 
  .load clr10\sos

4) !analyze –v

5) !sym noisy [verbose loading of the symbols]

6) .symfix c:\symcache [Fix the symbols path]

7) .cordll -ve -u –l

8) !runaway [to analyze]

10) .unload clr10\sos [Unload the SOS.]

11) .chain [to see whether SOS file has been loaded.]

12) ~* kb 2000 [Examine the native callstacks]

13) ~* e !clrstack [Examine the .net callstacks]

14) !syncblk [Determine the ID of the thread owning the lock]

15) ~10s      [move to thread 10, replace 10 with actual thread ID]

16) kb 2000   [examine native stack]

17) !clrstack [examine .net stack]

After executing the [ !syncblk ] you will came to know which thread is locked or in waiting state. Jump to the thread [~10S(Enter the thread number instead of 10)] and look at the .net call stack [ !clrstack ]or native call stack[ kb 2000 ]. It will let you know which function is causing the problem.

Postedby Navdeep Madan | 0 Comments    
Link and display two SharePoint calendar from SharePoint Designer
16 September 09 12:18 AM

Click here to Link and display two calendars in SharePoint Designer and after this here are the steps to format the list data.

Firstly, we were getting the xml in the “Modified By”. Here is the screen shot which shows  the same :-

clip_image002

We have click on the icon on right hand site as presented in the following image :-

clip_image004

We will get the “Date Field” selected “Modified By” in the first combo. In the second combo, “Format as” “Text”

clip_image006

Change the “Format as :” to “Rich Text”

clip_image008

Secondly, results are not coming according to current date and time.

clip_image010

Go to the filter and click on the link

clip_image012

We can see a grid where a grayed out line there with the text “Using the advanced expression”. It means I have set the formula to get the results using the “Advanced” tab at the bottom.

clip_image014

On the left panel, you can select the column and you have the functions mentioned in the “Select a function category” .You can change the function according to your requirement.

clip_image016

Postedby Navdeep Madan | 0 Comments    
How to find a SharePoint Desinger’s designed page?
15 September 09 08:04 PM

By default SharePoint pages are ghosted pages, store their content in the content database but for the look & feel  and layouts they referred to file system pages ( master pages, css, user controls etc..).If you modify any page in SharePoint Designer then if will become un-ghosted pages. All the data related to this page will get stored in the database. Any modification you do to the look and feel of this page will not be affected on the complete site.

 

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace GhostFinder
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args == null || args.Length < 1)
            {
                PrintUsage();
                return;
            }

            bool hasUrl = false;
            string url = null;
            for (int i = 0; i < args.Length; i++)
            {
                if (args[i] == "-url" && i + 1 < args.Length)
                {
                    url = args[i + 1];
                    hasUrl = true;
                }
            }

            if (!hasUrl)
            {
                PrintUsage();
                return;
            }

            using (SPSite site = new SPSite(url))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPFile file = web.GetFile(url);
                    if (file == null)
                    {
                        Console.WriteLine(string.Format("File '{0}' not found.", url), url);
                    }
                    else
                    {
                        SPCustomizedPageStatus page = file.CustomizedPageStatus;
                        Console.WriteLine("Status : " + page.ToString());
                    }
                }

            }
        }

        private static void PrintUsage()
        {
            Console.WriteLine(@"This is command line tool.");
            Console.WriteLine(@"Usage: To know customized page status, please provide the full page address i.e : -url [http://navdeepm1/sites/TeamSite/default.aspx]");
        }
    }
}

Postedby Navdeep Madan | 0 Comments    
How to delete OOB Announcements list from the SharePoint Site ?
11 September 09 12:03 AM

Announcements list template in SharePoint is installed as a feature with feature id 00bfea71-d1ce-42de-9c63-a44004ce0104. If you run the following command, the announcements section will get eloped from "Communications" section

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>stsdm -o deactivatefeature -id 00bfea71-d1ce-42de-9c63-a44004ce0104 -url "http://brs2r04-16:7000/sites/TestSite"

clip_image002

If you would like to bring it back , then you need to run the command stsadm command with activate feature :-

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>sts

dm -o deactivatefeature -id 00bfea71-d1ce-42de-9c63-a44004ce0104 -url "http://brs2r04-16:7000/sites/TestSite"

clip_image004

Here are the feature IDs of other List Templates :-

Libraries

Feature ID

List Template

Document Library

00bfea71-e717-4e80-aa17-d0c71b360101

101

Form Library

00bfea71-1e1d-4562-b56a-f05371bb0115

115

Wiki Page Library

00bfea71-c796-4402-9f2f-0eb9a6e71b18

119

Picture Library

00bfea71-52d4-45b3-b544-b1c71b620109

109

Data Connection Library

00bfea71-dbd7-4f72-b8cb-da7ac0440130

130

Translation Management Library

29d85c25-170c-4df9-a641-12db0b9d4130

1300

Slide Library

0be49fe9-9bc9-409d-abf9-702753bd878d

2100

Report Library

2510d73f-7109-4ccc-8a1c-314894deeb3a

433

Communications

Feature ID

List Template

Announcements

00bfea71-d1ce-42de-9c63-a44004ce0104

104

Contacts

00bfea71-7e6d-4186-9ba8-c047ac750105

105

Discussion Board

00bfea71-6a49-43fa-b535-d15c05500108

108

Tracking

Feature ID

List Template

Links

00bfea71-2062-426c-90bf-714c59600103

103

Calendar

00bfea71-ec85-4903-972d-ebe475780106

106

Tasks

00bfea71-a83e-497e-9ba0-7a5c597d0107

107

Project Tasks

00bfea71-513d-4ca0-96c2-6a47775c0119

150

Issue tracking

00bfea71-5932-4f9c-ad71-1557e5751100

1100

Survey

00bfea71-eb8a-40b1-80c7-506be7590102

102

Custom Lists

Feature ID

List Template

Custom List

00bfea71-de22-43b2-a848-c05709900100

100

Custom List in Datasheet View

00bfea71-3a1d-41d3-a0ee-651d11570120

120

Language and Translators

29d85c25-170c-4df9-a641-12db0b9d4130

1301

KPI List

065c78be-5231-477e-a972-14177cc5b3c7

432

Import Spread Sheet

   

Postedby Navdeep Madan | 1 Comments    
More Posts Next page »

This Blog

Syndication

Page view tracker