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
In your farm – what is the URL of your web app and site collection? You should use that url in the solution you are making to deploy it to….
In the VS Project this is a setting…. Highlight the project you are working on within the Solution Explorer and update the SiteURL property to reflect the local site you would like to use.