Hello,
I´m trying next example
http://msdn.microsoft.com/en-gb/library/ff630942.aspx
but I have the error:
 ‘Microsoft.SharePoint.SPContentTypeCollection’ no contiene una definición de ‘Cast’ ni se encontró ningún método de extensión ‘Cast’ que acepte un primer argumento de tipo ‘Microsoft.SharePoint.SPContentTypeCollection’ (¿falta una directiva de uso o una referencia de ensamblado?
With Google Translate ;Â
‘Microsoft.SharePoint.SPContentTypeCollection’ does not contain a definition for ‘Cast’ and found no extension method ‘Cast’ accepting a first argument of type ‘Microsoft.SharePoint.SPContentTypeCollection’ (are you missing a using directive or reference assembled?
The problem is in the line:
SPField newField = spWeb.Fields .Cast<SPField>() .FirstOrDefault(f => f.StaticName == “Team Project”);
Some idea?
Regards,
MarÃa
Hi Maria
Please check the feature scope or try to change the target site URL to see if it works. From memory the second error related to server not being available is due to access issues/site URL not being right.