Posts

Showing posts from 2011

Windows Azure Package Build Error: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Image
I often see when packaging Windows Azure project getting "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." error. To fix this issue I had to change Cloud Project User options file add add ServiceOutputDirectory entry to the file. 1) Open your Cloud Project file in Windows Explorer from Visual Studio. 2) Find Cloud Project file in opened directory (*.ccproj file) 3) Open file in Notepad 4) Add c:\azure entry Now your cloud visual studio project user options file looks similar to below: 5) Save file and open your solution again. 6) Package Solution and it should package without above error.

Get Sharepoint2010 Web Analytics from Sql Server

http://msdn.microsoft.com/en-us/library/dd773850(v=office.12).aspx http://otak-otak-it.blogspot.com/2011/05/how-to-get-sharepoint-2010-web.html

BCS Model with WCF Service

http://msdn.microsoft.com/en-us/library/ff953200.aspx

How to increase Sharepoint Silverlight Webpart Timeout

Often you may see the following message when loading Silverlight webpart on sharepoint. "To re-configure the Web Part or to provide a different Silverlight application (.xap), open the tool pane and then click Configure" You can download SLTimeout webpart and set Timeout property. http://buyevich.blogspot.com/2011/02/setting-time-out-for-silverlight-web.html

Hide Listview webpart Header/Columns

Add Content Editor Webpart to Page and set viewheadertr attribute to none and set Content Editor Webpart as Hidden. <style> .ms-viewheadertr { display: none;} </style> This hides all your list views  header.

Display Images From Database In Silverlight

http://www.dotnetcurry.com/ShowArticle.aspx?ID=220

Modular WPF with MEF (Managed Extensibility Framework) & MVVM

Screencast: Modular WPF with MEF & MVVM Tutorial Part 1 http://mark-dot-net.blogspot.com/2011/07/screencast-modular-wpf-with-mef-mvvm.html Screencast: Modular WPF with MEF & MVVM Tutorial Part 2 http://mark-dot-net.blogspot.com/2011/07/screencast-modular-wpf-with-mef-mvvm_11.html

Data Driven Applications with MVVM

Data Driven Applications with MVVM Part I: The Basics http://www.silverlightshow.net/items/Data-Driven-Applications-with-MVVM-Part-I.-The-Basics.aspx Data Driven Applications with MVVM Part II: Messaging, Unit Testing, and Live Data Sources http://www.silverlightshow.net/items/Data-Driven-Applications-with-MVVM-Part-II.-Messaging-Unit-Testing-and-Live-Data-Sources.aspx  Data Driven Applications with MVVM Part III: Validation, Bringing the UI Closer http://www.silverlightshow.net/items/Data-Driven-Applications-with-MVVM-Part-III.aspx  

Silverlight ViewModel Unit Testing

http://www.timmykokke.com/2010/12/unit-testing-mvvm-in-silverlight-sdn-eventcode-and-slides/ Explains async calls Unit Testing in Silverlight Part1 http://www.silverlightshow.net/items/Silverlight-Testing-Part-1-Testing-the-untested.aspx Part2 http://www.silverlightshow.net/items/Data-Driven-Applications-with-MVVM-Part-II.-Messaging-Unit-Testing-and-Live-Data-Sources.aspx

Creating FAST Managed Properties using Power shell

Add-PSSnapin Microsoft.SharePoint.PowerShell if([Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")-eq$null){throw "Unable to load Microsoft.SharePoint.dll";} Add-PSSnapin Microsoft.FASTSearch.PowerShell if([Reflection.Assembly]::LoadWithPartialName("Microsoft.FASTSearch.PowerShell")-eq$null){throw "Unable to load Microsoft.FASTSearch.dll";} function SetManagedProperties([string]$mpName, [int]$mpType = 0, [string]$cpName, [int]$sortableType = 0, [bool]$isQueryable = $false, [bool]$isRefiner = $false, [string]$ftiName, [int]$indexMapping = 1){     if($mpName -eq $null){         Write-Host "Error: Managed Property Name is null"         return;     }     if($mpType -eq 0){         Write-Host "Error: Managed Property Type should be grater than zero"         return;     }        if($cpName -eq $null){         Write-Host "Error: Crawled Property Name is null"         return;     }       

Power Shell Operators

http://www.computerperformance.co.uk/powershell/powershell_syntax.htm#Operators_

Power Shell Scripts

http://technet.microsoft.com/en-us/scriptcenter/dd742419 Explains Functions/Scripts/Args http://devcentral.f5.com/weblogs/Joe/archive/2009/01/13/powershell-abcs---p-is-for-parameters.aspx How to pass params: param(     [string] $optionalparam1, #an optional parameter with no default value     [string] $optionalparam2 = "default", #an optional parameter with a default value     [string] $requiredparam = $(throw ""requiredparam required."), #throw exception if no value provided     [string] $user = $(Read-Host -prompt "User"), #prompt user for value if none provided     [switch] $switchparam; #an optional "switch parameter" (ie, a flag)     )  eg: # Begin script foo.ps1 param([string]$foo = "foo", [string]$bar = $(Read-Host -promt "Bar Value")) Write-Host "Arg: $foo" Write-Host "Arg: $bar" #  End script foo.ps1 

Passing InitParams to the Silverlight App

http://abhijitjana.net/2010/11/03/how-to-pass-initparams-to-silverlight-application-which-is-hosted-as-sharepoint-2010-web-parts/ http://blogs.msdn.com/b/kaevans/archive/2008/10/08/hosting-silverlight-in-a-sharepoint-webpart.aspx Show chart data in Silverlight http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=26   Render Silver light with Silverlight 3.0 without silver light server control: http://karinebosch.wordpress.com/2009/07/17/integrating-silverlight-3-in-sharepoint-2007/ http://karinebosch.wordpress.com/2009/07/24/create-a-sharepoint-application-page-hosting-a-silverlight-3-application/

FAST Search Sharepoint2010 Installation

http://www.dotnetscraps.com/dotnetscraps/category/FAST-Search-2010.aspx

Sharepoint Videos

http://www.bing.com/videos/watch/video/overview-of-the-sharepoint-2010-developer-platform-sharepoint-dev-conference-oct/10tt5unqa?from=sharepermalink&cpkey=93872598-0349-442f-85bd-9ee9487e5127%7c%7c%7c%7c

Delegates

http://www.akadia.com/services/dotnet_delegates_and_events.html

Sharepoint with Powershell

http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=7 http://blumenthalit.net/blog/Lists/Posts/Post.aspx?ID=30

How does Sharepoint work?

Q.How Does SharePoint work? Ans. The browser sends a DAV packet to IIS asking to perform a document check in. PKMDASL.DLL, an ISAPI DLL, parses the packet and sees that it has the proprietary INVOKE command. Because of the existence of this command, the packet is passed off to msdmserv.exe, who in turn processes the packet and uses EXOLEDB to access the WSS, perform the operation and send the results back to the user in the form of XML. Ref: http://mysharepointwork.blogspot.com/2011/05/sharepoint-interview-questions-iii.html

SPWeb Dispose Patterns

http://blogs.msdn.com/b/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx

How to link your Site Definition with Site Template

When you have a new site definition (onet.xml) is ready, and in order to make that definition available into site template you have to create a webtemp*.xml file into 12\template\1033\xml\webtemp*.xml. The following is the thumb rule to create web temp file. The name of the template must match the name of the folder in which you store the site definition. Every site definition needs a unique identifier on your computer. The site definition allows for one configuration as you have defined it in Onet.xml. If you store your onet.xml in MyCustomSite folder ( 12\Template\SiteTemplates\MyCustomSite\XML\Onet.xml) you have to create your webtemp file as webtempMyCustomSite.xml in 12\Template\1033\XML\webtempMyCustomSite.xml. Make sure you have unique configuration ids maintained across the webtemp*.xml files on the computer. Ref: http://msdn.microsoft.com/en-us/library/dd583160(office.11).aspx

Enable Sharepoint Errors

By default Sharepoint won't show you actual error if any error occurs in the application. We have to disable custom errors & Callstack to true on web.config page. http://blog-sharepoint.blogspot.com/2009/12/sharepoint-webconfig-how-to-show-full.html

SPWeb Property Bag

The following url explains about SPWeb Property bag and how to add properties to the SPWeb Properties.  http://trentacular.com/2009/06/sharepoint-the-wicked-spwebproperties-propertybag/ Hierarchical Object Store (SPPersistedObject) Provides the methods for an object to automatically serialize its state, persist that state in a permanent store, retrieve it at a later time, and deserialize it back into an in-memory object. http://www.chaholl.com/archive/2011/01/30/the-skinny-on-sppersistedobject-and-the-hierarchical-object-store-in.aspx http://www.chaholl.com/archive/2010/12/13/persisting-a-stream-to-the-sharepoint-configuration-database.aspx

Create DefaultSharepoint Groups

I am recently trying to create site collection using Admin Web Service. When site creating using admin web service, share point not creating default share point groups. You have to write custom code to create share point default groups. The following is the code to create default sp groups. public bool CreateDefaultSPGroups( string url)     {         bool isGroupsCreated = false ;         try         {             using ( SPSite site = new SPSite (url))             {                 using ( SPWeb web = site.OpenWeb())                 {                     web.CreateDefaultAssociatedGroups(site.Owner.LoginName, site.SecondaryContact.LoginName, string .Empty);                     isGroupsCreated = true ;                 }             }         }         catch ( Exception ex)         {             isGroupsCreated = false ;   }         return isGroupsCreated;     }

RunPowershellCommand From ASPx Page

private void RunPowershellCommand( string loginName)     {         try         {             PSSnapInException exc = new PSSnapInException ();             RunspaceConfiguration rc = RunspaceConfiguration .Create();             PSSnapInInfo info = rc.AddPSSnapIn( "Microsoft.Sharepoint.Powershell" , out exc);             Runspace rs = RunspaceFactory .CreateRunspace(rc);             rs.Open();             Pipeline cmd = rs.CreatePipeline( string .Format( "set-SPSite -Identity http://sitecollection -SecondaryOwnerAlias {0}" ,loginName));                          Collection < PSObject > results = cmd.Invoke();             foreach ( PSObject str in results)                   SendToTextFile(str.ToString());           }         catch ( Exception ex)         {             SendToTextFile( "RunPowershellCommand() Error: " + ex.ToString());           }     }

Get all Site Colletions with Primary and Secondary Contatct User Info from Sharepoint Content Database

  --Get all site collections with primary secondary owner user info Select W . FullURl , W . Title , S . OwnerId , Max ( Case When S . OwnerId = U . tp_Id And S . Id = U . tp_siteId then U . tp_Login End ) as PrimaryLogin , Max ( Case When S . OwnerId = U . tp_Id And S . Id = U . tp_siteId then U . tp_Title End ) as PrimaryName , Max ( Case When S . OwnerId = U . tp_Id And S . Id = U . tp_siteId then U . tp_Email End ) as PrimaryEmailAddress , S . SecondaryContactID , Max ( Case When S . SecondaryContactID = U . tp_Id And S . Id = U . tp_siteId then U . tp_Login End ) as SecondaryLogin , Max ( Case When S . SecondaryContactID = U . tp_Id And S . Id = U . tp_siteId then U . tp_Title End ) as SecondaryName , Max ( Case When S . SecondaryContactID = U . tp_Id And S . Id = U . tp_siteId then U . tp_Email End ) as SecondaryEmailAddress , HostHeader , DiskUsed , LastContentChange , W . Id as WebId , W . SiteId , S . RootWebId

Custom Search Result in Sharepoint (FAST Search in 2010)

The following blog explains FAST 2010 for SharePoint 2010 Managed Properties. http://blogs.msdn.com/b/shad_phillips/archive/2010/05/31/fast-2010-for-sharepoint-2010-managed-properties.aspx

How to Delete SPView

Sharepoint Object model doesn't have any SPView.Delete method to delete view. If you want to delete SPView, you have to delete from SPList. void DeleteView( SPList list, SPView view) {      list.Views.Delete(view.ID);      list.Update(); }