<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.dotnetmafia.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Dot Net Mafia</title><link>http://www.dotnetmafia.com/blogs/</link><description>Group site for Tulsa area .NETdevelopers, with blogs dealing with (usually) .NET, SharePoint, and other Microsoft products, as well as some discussion of general programming related concepts.</description><dc:language>en-US</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Sharing an Index between SharePoint Farms</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/12/04/sharing-an-index-between-sharepoint-farms.aspx</link><pubDate>Thu, 04 Dec 2008 16:44:45 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:797</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;ve seen a few posts in the forums lately on this, so I thought I would post how I have implemented it in the past.&amp;nbsp; The issue is you have multiple SharePoint farms, but you want one index server to handle both of them.&amp;nbsp; This is actually pretty easy to setup, if you don&amp;#39;t mind your farms sharing the same Shared Services Provider (SSP).&amp;nbsp; The process below describes how to share the services of one farm&amp;#39;s SSP to other farms.&lt;/p&gt; &lt;p&gt;The first thing you need to do is decide which farm will host your index server and the configure it as normal.&amp;nbsp; We&amp;#39;ll refer to this as the parent farm.&amp;nbsp; On the parent farm, go to Central Administration -&amp;gt; Application Management -&amp;gt; Managed Shared Services between Farms.&amp;nbsp; Click on the option &amp;quot;&lt;em&gt;This farm will provide shared services to other farms&lt;/em&gt;&amp;quot;.&amp;nbsp; You will then be prompted for which SSP to use.&amp;nbsp; Most likely you only have one.&amp;nbsp; If you have more than one, click the one that has your search index on it.&amp;nbsp; You will then need to specify a user account.&amp;nbsp; This account should have permissions on the child farm already.&amp;nbsp; Typically, I would use the account that is being used for the application pool in central administration.&amp;nbsp; Click ok and then you should see a screen giving you information on how to configure a child farm.&amp;nbsp; Specifically it will give you the name of the parent farm&amp;#39;s database server and configuration database.&lt;/p&gt; &lt;p&gt;Now you will want to go to your child farm.&amp;nbsp; Go to the same page to manage shared services between farms, but this time click on &lt;em&gt;&amp;quot;This farm will consume shared services from another farm&amp;quot;.&amp;nbsp; &lt;/em&gt;Enter the database server and name in the fields provided.&amp;nbsp; I recommend using Windows authentication but keep in mind that account will need permission to access that configuration database.&amp;nbsp; This shouldn&amp;#39;t be an issue if both farms are using the same accounts for central administration though.&amp;nbsp; The last option to specify is for Local Excel Services (which can not be shared across farms).&amp;nbsp; For that you will have to specify an SSP that is local to that child farm.&lt;/p&gt; &lt;p&gt;It may not be entirely obvious what to do on the next screen at first.&amp;nbsp; The goal is to associate any web applications you have created on the child farm to your new parent SSP.&amp;nbsp; So the first thing you need to do is select the SSP of your parent from the list.&amp;nbsp; It will have the word parent next to it in parenthesis.&amp;nbsp; You then need to check the box next to any web application you have created and click ok.&amp;nbsp; Your services from the parent SSP have now been shared to the child.&amp;nbsp; This means any use of the Business Data Catalog, Enterprise Search, User Profile Application, or Session State will now be configured on the parent farm.&amp;nbsp; If you want to add additional child farms, just repeat these steps on each farm.&lt;/p&gt; &lt;p&gt;At this point you can execute a search query on a web application on either farm and get the same results.&amp;nbsp; However, you still need to configure a content source to crawl the child farm.&amp;nbsp; You will need to go the Content Sources page of your Search Administration on the parent SSP.&amp;nbsp; To index the child farm, you can do this in one of two ways.&amp;nbsp; First, you can simply modify the existing Local Office SharePoint Server Sites content source and add the URL of your web application of the child farm into the list of start URLs.&amp;nbsp; You can also create a new content source and specify the URL of the child farm there.&amp;nbsp; I tend to approve the latter approach since I can put the crawls on different schedules that way.&amp;nbsp; Either way you go, perform a full crawl when you are done.&amp;nbsp; Once the crawl is complete, you will now be able to search for results on both farms from either farm.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=797" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category></item><item><title>Slides and Code Samples from my talk at the OKC Developer Group</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/12/02/slides-and-code-samples-from-my-talk-at-the-okc-developer-group.aspx</link><pubDate>Tue, 02 Dec 2008 16:31:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:795</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Yesterday, I had the privilege to speak at the &lt;a href="http://www.okcpro.net"&gt;Oklahoma City Developer Group&lt;/a&gt; about SharePoint Development for ASP.NET Developers.&amp;nbsp; This talk was aimed at showing developers familiar with ASP.NET how they can get started with SharePoint.&amp;nbsp; In my talk I mentioned a number of posts from my blog, so I wanted to link them here.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/18/introduction-to-sharepoint-development-deploy-a-user-control-in-sharepoint.aspx"&gt;Introduction to SharePoint Development: Deploying a User Control in SharePoint&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx"&gt;Introduction to SharePoint Development: How to Build and Deploy a Web Part&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/08/21/sharepoint-to-api-translation-guide.aspx"&gt;SharePoint to API Translation Guide&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/03/05/how-to-remote-debugging-a-web-application.aspx"&gt;How to: Remote Debugging a Web Application&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/07/05/how-to-configure-code-access-security-for-a-web-part.aspx"&gt;How to: Configure Code Access Security for a Web Part&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/06/troubleshooting-cannot-import-web-part-error.aspx"&gt;Troubleshooting: Cannot Import Web Part Error&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/08/28/using-msbuild-to-create-a-sharepoint-wsp-file-on-build.aspx"&gt;Using MSBuild to Create a WSP file on Build&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/04/more-on-manfiest-xml.aspx"&gt;Deployment: More on Manifest.xml&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/07/30/how-to-build-your-own-smartpart-control.aspx"&gt;How to: Write your own SmartPart&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;In my talk I know I referenced my blog a lot, but when starting out with SharePoint development, there really is too much to cover in just a short one hour talk.&amp;nbsp; Hopefully, these posts will be a good starting point for anyone that wants to get started with SharePoint.&amp;nbsp; My slides and code samples from the talk are attached.&amp;nbsp; Feel free to leave a comment or shoot me an E-mail if you have any questions.&amp;nbsp; I want to thank the OKC Developer Group once again for having me.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=795" width="1" height="1"&gt;</description><enclosure url="http://www.dotnetmafia.com/blogs/dotnettipoftheday/attachment/795.ashx" length="282859" type="application/x-zip-compressed" /><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Presentations/default.aspx">Presentations</category></item><item><title>Joining the Herd - Isolator for SharePoint</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/25/joining-the-herd-isolator-for-sharepoint.aspx</link><pubDate>Tue, 25 Nov 2008 22:00:25 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:792</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I thought I would join the herd and help spread the word about Isolator for SharePoint.&amp;nbsp; It&amp;#39;s pretty exciting that there is actually a chance of doing TDD with SharePoint.&amp;nbsp; I look forward to trying it out.&lt;/p&gt;&lt;span class="Apple-style-span" style="word-spacing:0px;font:13px &amp;#39;Trebuchet MS&amp;#39;;text-transform:none;text-indent:0px;white-space:normal;letter-spacing:normal;border-collapse:separate;orphans:2;widows:2;-webkit-border-horizontal-spacing:0px;-webkit-border-vertical-spacing:0px;-webkit-text-decorations-in-effect:none;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0;"&gt; &lt;p&gt;Typemock are offering their new product for&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;amp;utm_medium=blog_4sp&amp;amp;utm_campaign=sp_bb"&gt;unit testing SharePoint&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html?utm_source=typeblog&amp;amp;utm_medium=sp_bb&amp;amp;utm_campaign=typeblog"&gt;unit test SharePoint&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;without a SharePoint server. To learn more&lt;a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;amp;utm_medium=blog_4sp&amp;amp;utm_campaign=sp_bb"&gt;click here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong style="font-weight:bold;"&gt;The first 50 bloggers&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;who blog this text in their blog and tell us about it, will get&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;font color="#ff0000"&gt;a Full Isolator license, Free&lt;/font&gt;. for rules and info&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html"&gt;click here&lt;/a&gt;.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span class="Apple-converted-space"&gt;Ingenious idea of how to spread the word guys.&amp;nbsp; I like it.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=792" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/TDD/default.aspx">TDD</category></item><item><title>How to: Get the Item Id from a document URL</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/24/how-to-get-the-item-id-from-a-document-url.aspx</link><pubDate>Mon, 24 Nov 2008 21:16:29 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:786</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Since I deal with Enterprise Search a lot, I often want to do things in SharePoint given nothing but a URL.&amp;nbsp; Unfortunately, there isn&amp;#39;t an API call (that I know that can take a URL can conveniently spit out an Item Id).&amp;nbsp; You can probably use a CAML query, but you would have to know which site collection to start with.&amp;nbsp; So how do we get the id?&amp;nbsp; It takes a number of steps, but it is pretty simple.&amp;nbsp; We first start by opening an SPSite object given the full URL to the item.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; (SPSite siteCollection = &lt;span style="color:blue;"&gt;new&lt;/span&gt; SPSite(url))&lt;/p&gt; &lt;p style="margin:0px;"&gt;{&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;using&lt;/span&gt; (SPWeb site = siteCollection.OpenWeb())&lt;/p&gt;&lt;/div&gt; &lt;p&gt;This assumes that the code is executing somewhere where opening an SPSite object for that URL is valid.&amp;nbsp; After that we open a SPWeb object which gives us an object representing the site that contains the document.&amp;nbsp; Next it is a matter of splitting the URL to get a file and folder URL.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// site url&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; siteUrl = site.Url;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// get the position of the last slash so that the string can be split&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; lastSlashPosition = url.LastIndexOf(&lt;span style="color:#a31515;"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// folder url&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; folderUrl = url.Substring(0, lastSlashPosition);&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// fileUrl&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; fileUrl = url.Substring(lastSlashPosition + 1);&lt;/p&gt;&lt;/div&gt; &lt;p&gt;We do this by using LastIndexOf(&amp;#39;/) (which of course assumes that the URL contains slashes).&amp;nbsp; At this point it is easy to get a reference to the file object representing the document.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// get file object&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;SPFile file = folder.Files[fileUrl];&lt;/p&gt;&lt;/div&gt; &lt;p&gt;This gives us a reference to the file which means we can get a reference to the item and then its Id.&amp;nbsp; Conversely if you are interested in the SPFolder object, you can just use.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// get folder object&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;SPFolder folder = site.GetFolder(folderUrl);&lt;/p&gt;&lt;/div&gt; &lt;p&gt;We will now get the SPListItem object which will give us its Id.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// get the list item&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;SPListItem item = file.Item;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// get the list item id&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; itemId = item.ID;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// get the uniqueId for the list item&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;Guid uniqueId = item.UniqueId;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Above, I have code to return the internal list item id as well as the unique id.&amp;nbsp; There are a few steps involved, but it seems to work pretty well.&amp;nbsp; You will of course want to add proper error handling and check for nulls along the way, but this should be a good start.&amp;nbsp; This is the same way I get the information I need for the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/31/introducing-document-link-handler-for-moss-2007-enterprise-search.aspx"&gt;Document Link Handler&lt;/a&gt; for Enterprise Search.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=786" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Speaking at Oklahoma City Developer's Group on December 1st</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/20/speaking-at-oklahoma-city-developer-s-group-on-december-1st.aspx</link><pubDate>Thu, 20 Nov 2008 15:02:44 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:782</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I am excited to announce that I am speaking at the &lt;a href="http://www.okcpro.net/"&gt;Oklahoma City Developer&amp;#39;s Group&lt;/a&gt; on December 1st.&amp;nbsp; I am giving a new talk geared at helping ASP.NET developers take the leap into SharePoint development.&amp;nbsp; This talk will closely tie into my recent Introduction to SharePoint Development (&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx"&gt;web part&lt;/a&gt;, &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/18/introduction-to-sharepoint-development-deploy-a-user-control-in-sharepoint.aspx"&gt;user control&lt;/a&gt;) series of posts.&amp;nbsp; This talk will show developers what they need to get started and how to tackle deployment.&amp;nbsp; We&amp;#39;ll also cover the basics of working with the SharePoint API.&amp;nbsp; The OKC group has a lunch meeting and an evening meeting.&amp;nbsp; I look forward to seeing everyone there.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=782" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Presentations/default.aspx">Presentations</category></item><item><title>Remote Debugging an InfoPath Form in Forms Services</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/18/remote-debugging-an-infopath-form-in-forms-services.aspx</link><pubDate>Tue, 18 Nov 2008 22:16:16 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:781</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Let&amp;#39;s face it, not every InfoPath form you write is going to work right on the first time.&amp;nbsp; If you are dealing with a Full Trust InfoPath from deployed in Forms Services at some point you may need to debug it.&amp;nbsp; In my server in question today, it did not have InfoPath nor Visual Studio installed.&amp;nbsp; However, it did have the Visual Studio Remote Debugging Monitor installed, so I decided to give it a shot.&lt;/p&gt; &lt;p&gt;Remote Debugging an InfoPath form is not much different that &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/03/05/how-to-remote-debugging-a-web-application.aspx"&gt;remote debugging&lt;/a&gt; anything else in SharePoint.&amp;nbsp; You run the Visual Studio Remote Debugging Monitor on the remote server and use Visual Studio to attach to the w3wp process on the remote server.&amp;nbsp; There are a couple of catches though.&amp;nbsp; First, if you are running VSTA from InfoPath the first thing you will notice is that there is no Attach to Process menu item in the Debug menu.&amp;nbsp; I am sure there is a way to get around it, but I just decided to close VSTA, open up Visual Studio 2005 (you have to use VS2005 since it is a .NET 2.0 project - although you may be able to upgrade it), and opened the .csproj file for the InfoPath project.&lt;/p&gt; &lt;p&gt;Opening the project with Visual Studio 2005 gives us the Attach to Process menu item.&amp;nbsp; InfoPath code behinds don&amp;#39;t generate PDB files by default.&amp;nbsp; So, you will need to go into the project properties, Build tab, and select Debug.&amp;nbsp; You then need to click on Advanced and set the Debug Info to &lt;em&gt;Full.&amp;nbsp; &lt;/em&gt;Build the project and you will have your PDB file.&amp;nbsp; Now you need to copy the DLL and the PDB file to the SharePoint server.&amp;nbsp; I have been copying these files into the feature folder of the workflow (i.e.: TEMPLATE\FEATURES\MyWorkflow).&amp;nbsp; I have no idea if this is the correct way to deploy Fully Trusted forms, but I have yet to find any documentation on how to do it and I know this works.&lt;/p&gt; &lt;p&gt;Once you have done that you are ready to attach to the w3wp process.&amp;nbsp; Don&amp;#39;t forget you can use &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2006/10/17/determine-the-application-pool-for-a-w3wp-process.aspx"&gt;iisapp.vbs&lt;/a&gt; to determine the correct w3wp process to attach to.&amp;nbsp; Set a breakpoint in your InfoPath code behind and then execute your InfoPath form or workflow.&amp;nbsp; If all goes well, your breakpoint will be hit.&amp;nbsp; If it doesn&amp;#39;t get hit, make sure you attached to the right w3wp and make sure that the DLL and PDB on your local computer match what is on the server.&lt;/p&gt; &lt;p&gt;One thing to note is when you start deploying subsequent updates, the DLL for your form will become locked and you won&amp;#39;t be able to deploy a new one.&amp;nbsp; Be aware of that if deploying via solution package as it won&amp;#39;t give you an error and it will just fail to copy things.&amp;nbsp; Once you are done debugging, you will need to terminate the current w3wp process to release the lock and update your DLL.&amp;nbsp; Also if you are just updating the code and not the form, it is ok to just copy the DLL and PDB out and not reinstall the feature and reattach the workflow.&amp;nbsp; That should save you some time.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=781" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Remote+Debugging/default.aspx">Remote Debugging</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/InfoPath/default.aspx">InfoPath</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Forms+Services/default.aspx">Forms Services</category></item><item><title>Introduction to SharePoint Development: Deploy a User Control in SharePoint</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/18/introduction-to-sharepoint-development-deploy-a-user-control-in-sharepoint.aspx</link><pubDate>Tue, 18 Nov 2008 20:07:58 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:780</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;A common question I get with new SharePoint developers is &amp;quot;How do I deploy my user control in SharePoint?&amp;quot;.&amp;nbsp; Many times they know of the &lt;a href="http://www.codeplex.com/smartpart"&gt;SmartPart&lt;/a&gt; or even how to &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/07/30/how-to-build-your-own-smartpart-control.aspx"&gt;make their own&lt;/a&gt;, but its the matter of deploying things that may not be clear.&amp;nbsp; Before starting this, you need to read how to &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx"&gt;build and deploy a web part&lt;/a&gt;.&amp;nbsp; Many of the concepts in that article are used here and explained in more detail.&lt;/p&gt; &lt;p&gt;To build a user control, you start in very much the same way as you do with regular ASP.NET.&amp;nbsp; My recommendation is to start by creating a web application project.&amp;nbsp; You can also use a regular class library, but its easier if you use a web application project since it has the file types you need as well as references.&amp;nbsp; If you already have a class library, you can easily convert it to a web application project using a &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/02/22/how-to-hack-a-class-library-project-into-a-web-application-project.aspx"&gt;hack&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Once you have a web application project, create your user control as normal.&amp;nbsp; Build the project and then its time to deploy.&amp;nbsp; We&amp;#39;ll first talk about where the files go on the server and then we&amp;#39;ll look at how we can get the files there with a solution package.&amp;nbsp; Let&amp;#39;s assume, I have a control called MyControl.ascx.&amp;nbsp; This file has to be deployed to the SharePoint server along with its binary.&amp;nbsp; If you are using a SmartPart, the ascx file to go is in a folder called UserControls located in the root of your web sites folder (by default c:\inetpub\wwwroot\wss\VirtualDirectories\80).&amp;nbsp; However with true SharePoint development you have to break the my controls go in X folder on my site way of thinking.&amp;nbsp; In SharePoint, everything is designed to be modular no matter how many web applications your server hosts.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I recommend creating your own web part to host your user control that will work with any folder.&amp;nbsp; SharePoint itself puts all user controls in the &lt;em&gt;CONTROLTEMPLATES &lt;/em&gt;folder in the 12 hive (C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12).&amp;nbsp; You can place your controls here as well, but I recommend creating a subfolder here to keep your controls separate.&amp;nbsp; In this case, I will create a folder called MyControls and copy MyControl.ascx into it.&amp;nbsp; At this point you are probably wondering what is the path to my control if its in the 12 hive?&amp;nbsp; On any SharePoint web application, there is a virtual directory called &lt;em&gt;_controltemplates&lt;/em&gt;.&amp;nbsp; This happens to map to the folder we need.&amp;nbsp; Therefore, the path you would reference in your web part (or any web page) would be &lt;em&gt;~/_controltemplates/MyControls/MyControl.ascx&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;Now, it is just a matter of deploying the binary.&amp;nbsp; In traditional ASP.NET, you could just copy the DLL of your web application project to the bin folder of the web application.&amp;nbsp; However, with SharePoint we can&amp;#39;t do that without specifying &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/07/05/how-to-configure-code-access-security-for-a-web-part.aspx"&gt;Code Access Security&lt;/a&gt; which is a pretty big undertaking when you are starting out.&amp;nbsp; For any file that is in the bin folder, SharePoint requires a security policy be set specifying exactly what permissions your DLL has.&amp;nbsp; I recommend deploying to the bin folder, but if you are just starting out, you don&amp;#39;t want to go there yet.&amp;nbsp; To get around this for now, there are two options: 1) Change the TrustLevel in the web.config to Full or 2) Deploy the DLL to the Global Assembly Cache.&amp;nbsp; I strongly recommend against #1, so for the sake of starting out, just copy your DLL to the GAC.&amp;nbsp; You will need to strongly name your assembly.&amp;nbsp; Any time you copy the DLL to the GAC, you will need to either recycle the application pool that your web application is using or reset IIS.&amp;nbsp; I know that can be a pain, but once you implement CAS, you don&amp;#39;t have to do that any more.&lt;/p&gt; &lt;p&gt;Just like with a web part, you have to add your user control as a safe control.&amp;nbsp; Just specify the assembly name and allowed namespaces.&lt;/p&gt;&lt;span class="Apple-style-span" style="word-spacing:0px;font:13px &amp;#39;courier new&amp;#39;;text-transform:none;text-indent:0px;white-space:normal;letter-spacing:normal;border-collapse:separate;orphans:2;widows:2;-webkit-border-horizontal-spacing:0px;-webkit-border-vertical-spacing:0px;-webkit-text-decorations-in-effect:none;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;SafeControls&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;SafeControl&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;Assembly&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=03afd371f1d50a3a&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;Namespace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyControls&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;TypeName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;*&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;Safe&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;True&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;SafeControls&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt; &lt;p&gt;At this point you are ready to try your new user control out.&amp;nbsp; To add it to a page like a web part, I recommend you follow the steps in this post to &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/07/30/how-to-build-your-own-smartpart-control.aspx"&gt;make your own SmartPart&lt;/a&gt;.&amp;nbsp; If you don&amp;#39;t know how to deploy a web part, follow my post on how to &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx"&gt;deploy a web part&lt;/a&gt;.&amp;nbsp; Once you have your smart part added, specify the path I mentioned above (&lt;em&gt;~/_controltemplates/MyControls/MyControl.ascx).&amp;nbsp; &lt;/em&gt;You can also add user controls to your master pages, just like you would in ASP.NET.&amp;nbsp; Just create the reference and add it to the .master. &lt;/p&gt; &lt;p&gt;This may sound like a lot at this point but it&amp;#39;s really not bad.&amp;nbsp; If there is enough interest in the article, I will try and get some code together in one package so people can use it as a starting point.&amp;nbsp; That is how you manually deploy a user control, we&amp;#39;ll move onto how we do it with a solution package.&lt;/p&gt; &lt;h5&gt;Deploying via Solution Package&lt;/h5&gt; &lt;p&gt;For deployment, we will pretty much follow what we did in the deployment of the web part.&amp;nbsp; For more details on building solution packages, please see that &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx"&gt;post&lt;/a&gt;.&amp;nbsp; In this case a feature is not necessary unless you want to automate the deployment of the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/15/using-caml-to-add-web-parts-to-an-existing-page.aspx"&gt;user controls onto an existing page&lt;/a&gt;.&amp;nbsp; The cab.ddf file only contains lines to copy the binary and .ascx file.&lt;/p&gt;&lt;pre&gt;; ** MyControls.wsp  **
.OPTION EXPLICIT     ; Generate errors 
.Set CabinetNameTemplate=MyControls.wsp     
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory
.Set CompressionType=MSZIP;** All files are compressed in cabinet files
.Set UniqueFiles=&amp;quot;ON&amp;quot;
.Set Cabinet=on
.Set DiskDirectory1=Package

Solution\manifest.xml manifest.xml

;binaries
bin\MyControls.dll MyControls.dll

;feature files

;template files
MyControl.ascx CONTROLTEMPLATES\MyControls\MyControl.ascx
&lt;/pre&gt;
&lt;p&gt;The Manfiest.xml file will contain entries to copy your ascx file out as well as copy your binary to the GAC.&amp;nbsp; It will also add the Safe Control entry that you need.&amp;nbsp; Here is what the file would look like.&amp;nbsp; The &lt;em&gt;TemplateFile&lt;/em&gt; element is used to specify every .ascx file that you want copied to the server.&amp;nbsp; More details on what you can do with the manifest file are &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/04/more-on-manfiest-xml.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Solution&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;SolutionId&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;{FA34A0BE-FEAA-4750-9E82-B313F62C5CF9}&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;ResetWebServer&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;TemplateFiles&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;TemplateFile&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Location&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;CONTROLTEMPLATES\MyControls\MyControl.ascx&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;TemplateFiles&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Assemblies&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Assembly&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;DeploymentTarget&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;GlobalAssemblyCache&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Location&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyControls.dll&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeControls&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeControl&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Assembly&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=03afd371f1d50a3a&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Namespace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyControls&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;TypeName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;*&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Safe&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;True&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeControls&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Assembly&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Assemblies&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Solution&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;At this point, you build and deploy the .wsp file as described in &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx"&gt;my web part post&lt;/a&gt;.&amp;nbsp; Again, I strongly recommend reading that post if you are not familiar with any of the deployment steps yet.&amp;nbsp; The nice thing about having your user control in a solution package is that it is now completely portable.&amp;nbsp; It can be deployed to your other SharePoint servers very easily.&amp;nbsp; Once you have mastered the process, I recommend you start deploying your binaries to the bin folder with &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/07/05/how-to-configure-code-access-security-for-a-web-part.aspx"&gt;Code Access Security&lt;/a&gt;.&amp;nbsp; Once you have the solution package built, adding CAS is pretty easy and it saves you from having to kill your app pool every time you do a deployment.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=780" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Deployment/default.aspx">Deployment</category></item><item><title>An Open Letter to Microsoft on Enterprise Search</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/11/an-open-letter-to-microsoft-on-enterprise-search.aspx</link><pubDate>Tue, 11 Nov 2008 19:32:57 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:773</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;The Enterprise Search component of MOSS 2007 and Search Server are great products and they can do a lot of great things out of the box, however I repeatedly see the same requests from clients.&amp;nbsp; I also see people having the same issues in the forums all the time.&amp;nbsp; I would like to summarize a list of things, we as a community, would like to see addressed in the future.&amp;nbsp; With the acquisition of Fast, a lot of these could become non-issues, but in the meantime this is what people are experiencing now.&amp;nbsp; Please add your comments or let me know anything you think I missed.&amp;nbsp; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Wildcard Searching - Yes, Enterprise Search supports it but not out of the box.&amp;nbsp; &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/06/09/new-web-part-for-wildcard-search-in-enterprise-search.aspx"&gt;WildcardSearchWebPart&lt;/a&gt; helps, but it&amp;#39;s just a hack and this functionality should be built in.&amp;nbsp; It doesn&amp;#39;t help with People Search though.&lt;/li&gt; &lt;li&gt;Unseal classes in Microsoft.Office.Server.Search.Web - We are given limited functionality in displaying search results out of the box, help us out by not making these classes sealed so that we can add our own functionality.&amp;nbsp; You did this with the Federated Search classes and it was a step in the right direction.&lt;/li&gt; &lt;li&gt;Provide links to document libraries, sites, and editing of results containing documents.&amp;nbsp; The &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/31/introducing-document-link-handler-for-moss-2007-enterprise-search.aspx"&gt;Document Link Handler&lt;/a&gt; helps with this.&lt;/li&gt; &lt;li&gt;Provide zip and download support - LiveLink has a lot of these types of options and users want them.&lt;/li&gt; &lt;li&gt;Allow custom sorting using managed properties in the CoreResultsWebPart.&lt;/li&gt; &lt;li&gt;Include faceted search out of the box.&lt;/li&gt; &lt;li&gt;Add keyword specific features to Full Text SQL Queries - It turns out people want wildcard searching and a variety of other features that word only when performing a keyword search.&amp;nbsp; Things like Best Bets, RSS, Keyword Highlighting, and Search Summary &lt;a href="http://www.google.com/enterprise/gsa/"&gt;do not work&lt;/a&gt; when using Full Text SQL.&lt;/li&gt; &lt;li&gt;Display more accurate result counts - I know this is the nature of a way a search engine works.&amp;nbsp; In the case where I am using the BDC to index a table full of widgets, the end user always knows exactly how many widgets there are and he or she starts to ask questions.&lt;/li&gt; &lt;li&gt;Fix the page where you map crawled properties - It is not resizable and you can&amp;#39;t see what you are picking when the crawled property has a long name.&amp;nbsp; It would also be nice if you could select more than one at a time.&lt;/li&gt; &lt;li&gt;Stop using WSS Search in MOSS - You can work around this, but there should be no reason why a call is made to OSSSearchResults.aspx on a MOSS server.&amp;nbsp; The WSS search page offers next to 0 customization options.&lt;/li&gt; &lt;li&gt;Provide a way to see which IFilters you have installed.&lt;/li&gt; &lt;li&gt;Provide and stsadm command to import/export Content Sources, Managed Properties, Crawled Properties, and Scopes.&amp;nbsp; Thank you &lt;a href="http://www.codeplex.com/SSSPPC"&gt;SSSPPC&lt;/a&gt; for helping with that right now.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Ok, I know I am asking a lot, but just take a look at the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointsearch/threads/"&gt;forums&lt;/a&gt;, these are real issues people deal with every day.&amp;nbsp; I still enjoy working with the product every day and am so thankful that the community has given so much to make it better.&amp;nbsp; I am very excited what the next version of search will have in store for us.&amp;nbsp; However, these are things that should be addressed in one way or another lest companies start going out and buying &lt;a href="http://www.google.com/enterprise/gsa/"&gt;Google Search Appliances&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; If you have anything you would like to add, please leave a comment.&amp;nbsp; Thanks.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=773" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category></item><item><title>A Note on Content Type Inheritance</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/04/a-note-on-content-type-inheritance.aspx</link><pubDate>Tue, 04 Nov 2008 17:15:47 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:765</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I ran into this issue a while back so I thought I would post on it.&amp;nbsp; I had a scenario where we wanted to create a simple content type to use as a base content type for all future content types at a comapany (i.e.: Company Base Document).&amp;nbsp; At the time we did not know what site columns we wanted included, so we didn&amp;#39;t include any FieldRefs to site columns.&amp;nbsp; We just inherited from this type into another more project specific document type.&amp;nbsp; It seemed like a good idea at the time, but it of course caused a number of problems.&lt;/p&gt; &lt;p&gt;It appears that if you do not specify any FieldRef elements in your content type definition that any other fields further up in the inheritance tree will also not get inherited.&amp;nbsp; This caused things like the Title field (inherited from item) to not be included in our content type.&amp;nbsp; The lesson to be learned here is a) plan better and have your fields defined first and b) make sure that you always specify at least one FieldRef in your content type definition.&amp;nbsp; I am sure there is a technical reason for this, but I thought I would throw it out there in case someone else runs into the issue in the future.&lt;/p&gt; &lt;p&gt;Also if you haven&amp;#39;t checked out my latest &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/31/introducing-document-link-handler-for-moss-2007-enterprise-search.aspx"&gt;addon for Enterprise Search&lt;/a&gt;, go check it out.&amp;nbsp; I am pretty excited about it and the users I have shown it to so far have found a lot of value in it.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=765" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Content+Type/default.aspx">Content Type</category></item><item><title>Introducing Document Link Handler for MOSS 2007 Enterprise Search</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/31/introducing-document-link-handler-for-moss-2007-enterprise-search.aspx</link><pubDate>Fri, 31 Oct 2008 18:30:17 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:763</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Since, I have started working with Enterprise Search, I have received many requests looking for ways to improve what we can do with documents.&amp;nbsp; The search results screen in MOSS, as flexible as it is, has always been lacking in features compared to search results of other ECM systems.&amp;nbsp; Common feature requests I have seen from clients include:&amp;nbsp; editing the document, viewing properties, linking to the folder or document library, linking to the site the document is in, zip and download, view version history, and more.&amp;nbsp; Today I am pleased to announce a simple solution which can handle many (but not all) of these common requests.&lt;/p&gt; &lt;p&gt;So how do we accomplish this?&amp;nbsp; I decided to build a simple ASP.NET Handler (.ashx) file to parse the URL from a document on the search results page and redirect a user to the page that he or she wanted.&amp;nbsp; Links to the handler can easily be added by modifying the XSL of the CoreResultsWebPart.&lt;/p&gt; &lt;p&gt;The code of the handler is pretty simple.&amp;nbsp; I take the URL passed via query string, split it to get the filename and the path and then I open an SPWeb object that references that site.&amp;nbsp; Once I have access to an SPFolder and SPFile object for the document, I can determine URLs for the document library and folder.&amp;nbsp; Take a look at the code if you are interested.&amp;nbsp; It might need some optimization, but it is a good starting point.&lt;/p&gt; &lt;p&gt;Installation is simple.&amp;nbsp; Install the included .wsp file contained in the package folder.&amp;nbsp;&amp;nbsp; The syntax is listed in the readme.txt file if you need it.&amp;nbsp; This will copy the DocumentLink.ashx file into your layouts folder.&amp;nbsp; To add the links to your search results, go to the results page of your search center and edit your CoreResultsWebPart.&amp;nbsp; In the Data View Properties, click on the XSL Editor button.&amp;nbsp; Replace the XSL in the window with the contents of the included SampleCoreResults.xslt file.&amp;nbsp; If you have already made customizations to this file or you only want certain links, you may copy just the lines you need from the readme.txt file.&lt;/p&gt; &lt;p&gt;After you have changed the XSLT, apply the changes and execute a search query.&amp;nbsp; If you receive an error, then your XSL is probably malformed.&amp;nbsp; Open the XSL with Visual Studio if necessary to help find the error.&amp;nbsp; If all goes well, you should have search results that look like the one below.&amp;nbsp; Note, that these links will only show up for search results that are documents (IsDocument:1).&amp;nbsp; This works together in conjunction with my post earlier this week on adding an &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/27/adding-an-edit-document-link-to-enterprise-search-results.aspx"&gt;edit document link&lt;/a&gt; to search results.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/IntroducingDocumentLinkHandlerforMOSS200_869B/SearchResultsDocumentLinks_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="76" alt="SearchResultsDocumentLinks" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/IntroducingDocumentLinkHandlerforMOSS200_869B/SearchResultsDocumentLinks_thumb.jpg" width="379" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The binaries and source code are available at &lt;a href="http://www.codeplex.com/MOSSSearchLinks"&gt;CodePlex&lt;/a&gt;.&amp;nbsp; If you have any issues, please log them there on the Issue Tracker.&amp;nbsp; If you have any idea of other kinds of links we can provide off of a document library, please leave a comment.&amp;nbsp; This can also be used with the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/14/wildcard-search-version-1-0-release-3.aspx"&gt;Wildcard Search&lt;/a&gt; web part.&amp;nbsp; Hopefully this will help many others out there deliver even richer search solutions to their customers.&amp;nbsp; Thanks.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.codeplex.com/MOSSSearchLinks"&gt;Document Link Handler for MOSS 2007 Enterprise Search&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=763" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Wildcard+Search/default.aspx">Wildcard Search</category></item><item><title>Real World Dojo part 5: Custom Components</title><link>http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/28/761.aspx</link><pubDate>Tue, 28 Oct 2008 21:47:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:761</guid><dc:creator>JamesAshley</dc:creator><slash:comments>0</slash:comments><description>Dojo has its own built-in system for creating your own server-side controls.  It&amp;#39;s (arguably) better to use that than, say, creating a .NET user control....(&lt;a href="http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/28/761.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=761" width="1" height="1"&gt;</description><enclosure url="http://www.dotnetmafia.com/blogs/jamesashley/attachment/761.ashx" length="5466" type="application/zip" /><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/coding/default.aspx">coding</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/Not+Dot+Net/default.aspx">Not Dot Net</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/open+source/default.aspx">open source</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/javascript/default.aspx">javascript</category></item><item><title>Adding an Edit Document Link to Enterprise Search Results</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/27/adding-an-edit-document-link-to-enterprise-search-results.aspx</link><pubDate>Mon, 27 Oct 2008 22:18:05 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:759</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>8</slash:comments><description>&lt;p&gt;I have seen a lot of requests to get more functionality on search results for documents lately.&amp;nbsp; People want to be able to edit documents, go to the folder the document is in, go to the site, view properties, etc.&amp;nbsp; I have solutions for all of those which I will be sharing in the next few days.&amp;nbsp; However, I wanted to share this one first, because it is easy to implement and does not require any custom code.&amp;nbsp; The goal is to get a link that will allow you to edit the document (instead of opening it in read only mode) directly from your search results.&amp;nbsp; &lt;/p&gt; &lt;p&gt;As you will see the solution is actually quite simple.&amp;nbsp; Start by editing your results.aspx page and then edit the CoreResultsWebPart.&amp;nbsp; I have chosen to put my Edit Document link on the line following the title of the document.&amp;nbsp; In the Data View Properties of the web part, click XSL Editor.&amp;nbsp; Scroll down and look for the span with a class of &lt;em&gt;srch-Title &lt;/em&gt;and insert the following block of code after the closing span and before the &lt;em&gt;srch-Description&lt;/em&gt;.&lt;/p&gt; &lt;p class="MsoPlainText" style="margin:0in 0in 0pt;"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;div class=&amp;quot;srch-Description&amp;quot;&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoPlainText" style="margin:0in 0in 0pt;"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;a href=&amp;quot;{$url}&amp;quot; onclick=&amp;quot;return DispEx(this,event,&amp;#39;TRUE&amp;#39;,&amp;#39;FALSE&amp;#39;,&amp;#39;FALSE&amp;#39;,&amp;#39;SharePoint.OpenDocuments.3&amp;#39;,&amp;#39;0&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoPlainText" style="margin:0in 0in 0pt;"&gt;&lt;font face="Consolas"&gt;&amp;#39;,&amp;#39;SharePoint.OpenDocuments&amp;#39;,&amp;#39;&amp;#39;,&amp;#39;&amp;#39;,&amp;#39;&amp;#39;,&amp;#39;1&amp;#39;,&amp;#39;0&amp;#39;,&amp;#39;0&amp;#39;,&amp;#39;0x7fffffffffffffff&amp;#39;)&amp;quot;&lt;/font&gt;&lt;font face="Consolas"&gt;&amp;gt;Edit Document&amp;lt;/a&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoPlainText" style="margin:0in 0in 0pt;"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/div&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt; &lt;p&gt;Save the XSL and click Apply.&amp;nbsp; You should now see an Edit Document link in your search results similar to the one below.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/AddinganEditDocumentLinktoEnterpriseSear_F16B/SearchResultsEditDocumentLink.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="84" alt="SearchResultsEditDocumentLink" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/AddinganEditDocumentLinktoEnterpriseSear_F16B/SearchResultsEditDocumentLink_thumb.jpg" width="309" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Clicking on the Edit Document link will present the user with the Read Only / Edit menu just like they get when they are opening the document from a document library.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/AddinganEditDocumentLinktoEnterpriseSear_F16B/SearchResultsEditDialog_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="178" alt="SearchResultsEditDialog" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/AddinganEditDocumentLinktoEnterpriseSear_F16B/SearchResultsEditDialog_thumb.jpg" width="387" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;How did I figure this magic out?&amp;nbsp; It really was pretty simple, I just looked at a document library page and figured out what script method was being called.&amp;nbsp; If you spent money on a high dollar product just to get this feature, I am sorry.&amp;nbsp; Also remember that the Edit Document functionality only works in Internet Explorer.&amp;nbsp; Try it out and see if it works for you.&amp;nbsp; For other document functions such as Go to Folder, View Properties, and View Version History, take a look at my &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/31/introducing-document-link-handler-for-moss-2007-enterprise-search.aspx"&gt;Document Link Handler&lt;/a&gt; for Enterprise Search.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=759" width="1" height="1"&gt;</description></item><item><title>Real World Dojo part Four: User Feedback</title><link>http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/23/755.aspx</link><pubDate>Thu, 23 Oct 2008 22:13:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:755</guid><dc:creator>JamesAshley</dc:creator><slash:comments>0</slash:comments><description>You have to let the user know what&amp;#39;s going on. That&amp;#39;s one of the main points, isn&amp;#39;t it?...(&lt;a href="http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/23/755.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=755" width="1" height="1"&gt;</description><enclosure url="http://www.dotnetmafia.com/blogs/jamesashley/attachment/755.ashx" length="4300" type="text/html" /><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/coding/default.aspx">coding</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/Not+Dot+Net/default.aspx">Not Dot Net</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/open+source/default.aspx">open source</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/AJAX/default.aspx">AJAX</category></item><item><title>Real World Dojo part Three: AJAX</title><link>http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/23/754.aspx</link><pubDate>Thu, 23 Oct 2008 21:19:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:754</guid><dc:creator>JamesAshley</dc:creator><slash:comments>0</slash:comments><description>I&amp;#39;ve avoided this as long as possible.  It&amp;#39;s time to bite the bullet and do some AJAX....(&lt;a href="http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/23/754.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=754" width="1" height="1"&gt;</description><enclosure url="http://www.dotnetmafia.com/blogs/jamesashley/attachment/754.ashx" length="3684" type="text/html" /><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/coding/default.aspx">coding</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/Not+Dot+Net/default.aspx">Not Dot Net</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/open+source/default.aspx">open source</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/javascript/default.aspx">javascript</category></item><item><title>Intro to SharePoint Development: How to Build and Deploy a Web Part</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx</link><pubDate>Wed, 22 Oct 2008 12:50:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:751</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I&amp;#39;ve recently helped out a number of developers new to SharePoint and I found that I have been often asked the same types of questions.&amp;nbsp; Most of those involve getting started and deployment, so today, I am beginning my series on getting started with SharePoint.&amp;nbsp; Most new developers find starting out pretty overwhelming, but once you get used to it, it does all make sense.&amp;nbsp; Hopefully this post will help the community and keep new SharePoint developers from getting scared off.&amp;nbsp; There have been a lot of posts on this topic I admit.&amp;nbsp; Since there are so many ways to do things, I wanted to write this post as a reference to new developers so they can see how I usually do things.&amp;nbsp; What I find is that most developers have no trouble getting a web part built, but when it comes time to deploy it, they are lost.&amp;nbsp; There are multiple ways to do this and not all of them are necessarily the right way.&lt;/p&gt; &lt;h4&gt;Environment&lt;/h4&gt; &lt;p&gt;Let&amp;#39;s start by talking about your development environment.&amp;nbsp; In an ideal situation, you probably have your own virtual machine with Windows Server 2008 (or 2003), MOSS 2007, and Visual Studio 2008 installed.&amp;nbsp; However, maybe you don&amp;#39;t have your own dedicated machine and you are going to be developing on a Windows XP machine, but deploying to a remote SharePoint server.&amp;nbsp; This is fine, but you are going to have to do some things a little differently.&amp;nbsp; First, you won&amp;#39;t be able to install the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/06/04/wss-3-0-tools-visual-studio-extensions-1-2-running-under-windows-vista.aspx"&gt;Visual Studio Extensions for SharePoint&lt;/a&gt;.&amp;nbsp; You can live without this though because most people I have ran into say they don&amp;#39;t use them.&amp;nbsp; Secondly, when it comes to deployment (which we&amp;#39;ll talk about down below), you are going to have to copy your source files (either manually or via solution package) to the server.&amp;nbsp; You are also going to have to &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/03/05/how-to-remote-debugging-a-web-application.aspx"&gt;remote debug&lt;/a&gt; but fret not my post on it makes it easy.&lt;/p&gt; &lt;p&gt;If you are developing on a desktop, another thing you will need to do is copy the SharePoint assemblies to your computer.&amp;nbsp; We can easily get these from a deployed SharePoint server.&amp;nbsp; However, this is a great time to take an aside and talk about some of the SharePoint directory structure.&lt;/p&gt; &lt;p&gt;&lt;em&gt;C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12&lt;/em&gt;&lt;/p&gt; &lt;p&gt;All SharePoint developers have that file path permanently burned into their memory.&amp;nbsp; It is often referred to as the 12 hive.&amp;nbsp; A lot of things happen within this folder.&amp;nbsp; Subfolders here contain the SharePoint binaries, Master Pages, Application Pages, User Controls, Configuration Files, and Features.&amp;nbsp;&amp;nbsp; Although SharePoint will let you customize any file in here, in general you don&amp;#39;t want to make changes to any of these builtin files as it puts you in an unsupported scenario.&amp;nbsp; If you want to customize a master page or a style, it is typically best that you make a copy of what you want to customize and go from there.&amp;nbsp; Here is a quick list of some of the key folders and what they are used for.&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2"&gt;  &lt;tr&gt; &lt;td&gt;&lt;strong&gt;Folder&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CONFIG&lt;/td&gt; &lt;td&gt;Contains &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/07/05/how-to-configure-code-access-security-for-a-web-part.aspx"&gt;partial trust&lt;/a&gt; configuration files&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;ISAPI&lt;/td&gt; &lt;td&gt;Binaries and SharePoint Web Services&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;LOGS&lt;/td&gt; &lt;td&gt;Error Logs (look here first when you get a strange error)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TEMPLATE\CONTROLTEMPLATES&lt;/td&gt; &lt;td&gt;User Controls&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TEMPLATE\FEATURES&lt;/td&gt; &lt;td&gt;SharePoint Features (turns functionality on and off)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TEMPLATE\IMAGES&lt;/td&gt; &lt;td&gt;MainImages Folder&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TEMPLATE\LAYOUTS&lt;/td&gt; &lt;td&gt;Pages and Styles&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TEMPLATE\SiteTemplates&lt;/td&gt; &lt;td&gt;Definitions avaiable for deploying new sites&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TEMPLATE\THEMES&lt;/td&gt; &lt;td&gt;Used to create custom themes in SharePoint&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TEMPLATE\XML&lt;/td&gt; &lt;td&gt;Contains XSDs for any XML used with SharePoint&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;p&gt;Enough on that tangent, back to the assemblies that we need to copy.&amp;nbsp; Go to the above path and then go into the ISAPI folder.&amp;nbsp; Copy all of the DLLs from this folder onto your desktop machine in the corresponding folder name.&amp;nbsp; If you don&amp;#39;t have that folder, create it.&amp;nbsp; You may also copy them to the Global Assembly Cache as well.&amp;nbsp; Once you are this point, you are ready to being building a web part.&lt;/p&gt; &lt;h4&gt;Coding the Web Part&lt;/h4&gt; &lt;p&gt;Start by creating a new class library project in Visual Studio.&amp;nbsp; There are packages and tools out there to automate some of these steps, but its best that you learn how to do it first by hand, so you know how to troubleshoot it should something go wrong.&amp;nbsp; Next, you will want to add (at a minimum) a reference to Microsoft.SharePoint.dll.&amp;nbsp; You can either grab it out of the GAC (will be listed under Windows SharePoint Services) or use the copy that you put in your ISAPI folder.&amp;nbsp; After you add it, make sure &lt;em&gt;Copy Local&lt;/em&gt; is set to false on your reference.&amp;nbsp; You will also want to add System.Web since more than likely your web part will use an ASP.NET control in it.&amp;nbsp; You are now ready to create your web part.&amp;nbsp; To do this, create a new class and add a using statement for &lt;em&gt;Microsoft.SharePoint&lt;/em&gt;.&amp;nbsp; In the past, you would derive your class from &lt;em&gt;Microsoft.SharePoint.WebPart&lt;/em&gt; (and you still can), but now the more accepted way of doing things is to derive from the new &lt;em&gt;System.Web.UI.WebParts.WebPart&lt;/em&gt; class.&amp;nbsp; The latter comes from ASP.NET 2.0 and can actually be deployed outside of SharePoint.&amp;nbsp; Here is what our class is going to look like.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;TestWebPart&lt;/span&gt; : System.Web.UI.WebControls.WebParts.&lt;span style="color:#2b91af;"&gt;WebPart&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;{&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; CreateChildControls()&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;base&lt;/span&gt;.CreateChildControls();&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Controls.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Label&lt;/span&gt;(){Text = &lt;span style="color:#a31515;"&gt;&amp;quot;My Test Web Part (Hello World)!&amp;quot;&lt;/span&gt;});&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p style="margin:0px;"&gt;}&lt;/p&gt;&lt;/div&gt; &lt;p&gt;The content of the class is simple.&amp;nbsp; We use the overridden &lt;em&gt;CreateChildControls&lt;/em&gt; method to add ASP.NET controls to the page to do the rendering.&amp;nbsp; I simply call Control.Add and add a Label control with the text above.&amp;nbsp; Compile it and this web part is good to go, but there is the small matter of deploying it.&amp;nbsp; Compiling it yield you a DLL that has be deployed to SharePoint somehow.&amp;nbsp; SharePoint also needs to know where the web part is and how to reference it.&amp;nbsp; This is where the .webpart file comes in.&lt;/p&gt; &lt;h4&gt;Describing the WebPart&lt;/h4&gt; &lt;p&gt;The .webpart file is an XML file that tells SharePoint what to call your DLL and what assembly it is located in.&amp;nbsp; The easiest way to get started creating this file is to copy another one in SharePoint.&amp;nbsp; You can find plenty of examples by going to your web part gallery (Site Root -&amp;gt; Site Settings -&amp;gt; Web Parts).&amp;nbsp; this file simply describes the class and assembly of your web part as well as some default properties (i.e.: it sets a title and description).&amp;nbsp; You can also add your own properties by specifying a series of attributes on a property in your class.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;webParts&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;webPart&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/WebPart/v3&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;metaData&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyWebPart.TestWebPart, MyWebPart, Version=1.0.0.0, Culture=neutral&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;importErrorMessage&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Cannot import this Web Part.&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;importErrorMessage&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;metaData&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;data&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;properties&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Title&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;My Web Part&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Description&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;A test web part.&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;properties&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;data&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;webPart&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Note: There is also a &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/08/21/the-difference-between-dwp-and-webpart.aspx"&gt;.dwp&lt;/a&gt; file, which comes from version 2, that can describe your webpart as well.&amp;nbsp; It still works but it is consider deprecated.&lt;/p&gt; &lt;h4&gt;Ghetto Deploying&lt;/h4&gt; &lt;p&gt;So far, we have built a web part and created a .webpart file so now it is time to deploy it.&amp;nbsp; We&amp;#39;ll start by doing it the &lt;em&gt;wrong&lt;/em&gt; way.&amp;nbsp; The first thing to know is that you can&amp;#39;t just copy your DLL into the bin folder of your web application unless you change to full trust (not recommended) or specify &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/07/05/how-to-configure-code-access-security-for-a-web-part.aspx"&gt;Code Access Security&lt;/a&gt;.&amp;nbsp; Specifying CAS when first starting out will make even the most seasoned developers run for the hills.&amp;nbsp; So we are going to start by deploying to the GAC.&amp;nbsp; In almost all situations, I recommend against this, but for the sake of getting you started, it is ok.&amp;nbsp; You can then follow the Code Access Security post later on how to set up everything properly.&lt;/p&gt; &lt;p&gt;Start by copying your compiled DLL into the Global Assembly Cache of your SharePoint server.&amp;nbsp; Keep in mind anytime you update this DLL, you will need to either reset IIS or recycle the application pool (otherwise the old version stays in memory).&amp;nbsp; The next thing you need to do is upload the .webpart file to the web part gallery of your site collection (again Site Root -&amp;gt; Site Settings -&amp;gt; Web Parts).&amp;nbsp; At this point, SharePoint will be able to recognize your web part and it can be added to a page.&amp;nbsp; If you click on the name of the web part in the gallery (in this case MyWebPart.webpart), it will display a preview of what it will look like on a page.&amp;nbsp; If everything is working correctly, you will see your web part, otherwise you will get an error.&amp;nbsp; At this point, you will have the following error.&lt;/p&gt; &lt;p&gt;&lt;span class="Apple-style-span" style="word-spacing:0px;font:13px verdana;text-transform:none;text-indent:0px;white-space:normal;letter-spacing:normal;border-collapse:separate;orphans:2;widows:2;-webkit-border-horizontal-spacing:0px;-webkit-border-vertical-spacing:0px;-webkit-text-decorations-in-effect:none;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0;"&gt;&lt;em&gt;A web part on this web part page cannot be displayed or imported because it is not registered on this site as safe.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;This is because there is one more step to do.&amp;nbsp; Every web part or user control in SharePoint must be registered as safe to execute in the web.config.&amp;nbsp; To do this, find the &lt;em&gt;SafeControls&lt;/em&gt; element near the top and add the following line (changing it with your fully qualified assembly path).&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeControls&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeControl&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Assembly&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyWebPart, Version=1.0.0.0, Culture=neutral&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Namespace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyWebPart&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;TypeName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;*&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Safe&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;True&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeControls&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Now when you go back to the web part gallery, it should give you a preview of your web part.&amp;nbsp; If it doesn&amp;#39;t check your assembly paths and make sure the file is deployed.&amp;nbsp; If you still have issues, check out this post on &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/06/troubleshooting-cannot-import-web-part-error.aspx"&gt;troubleshooting a web part&lt;/a&gt;.&amp;nbsp; Assuming you were able to get the web part to preview, you can also go add it to a page by going to any page, clicking Edit Page and then Add Web Part.&amp;nbsp; Scroll through the list until you find your web part and select it.&amp;nbsp; You should then see your web part on the page.&lt;/p&gt; &lt;h4&gt;Features&lt;/h4&gt; &lt;p&gt;So we talked about deploying a web part the wrong way.&amp;nbsp; Ok, it&amp;#39;s not necessarily wrong, but it really adds a lot of extra work&amp;nbsp; This can be automated quite a bit by using features and solution packages.&amp;nbsp; Creating a feature, allows you to turn on and off customizations to SharePoint at the click of a button.&amp;nbsp; They can be used to deploy web parts, site definitions, workflows, document libraries, and plenty of other things.&amp;nbsp; In this case, we are building a feature to automate the deployment of our .webpart file.&amp;nbsp; You can also specify a class (Feature Receiver) that is executed when the feature is installed, activated, deactivated, or uninstalled.&amp;nbsp; A feature typically consists of two XML files.&amp;nbsp; The first file Feature.xml (must be named that), describes the feature and where its feature receiver is (if any).&amp;nbsp; &lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Feature&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;{BDD425C3-CA50-4aee-9170-73954044D764}&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Scope&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Site&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Hidden&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;False&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Title&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;My Web Part&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Description&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;My Test Web Part&lt;/span&gt;&amp;quot;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ElementManifests&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ElementManifest&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Location&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Elements.xml&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ElementManifests&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Feature&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;The &lt;em&gt;Id&lt;/em&gt; element contains a GUID.&amp;nbsp; Every feature needs a different one.&amp;nbsp; The &lt;em&gt;Scope &lt;/em&gt;attribute specifies where to deploy the feature.&amp;nbsp; Possible values are &lt;em&gt;Site, Web, WebApplication, &lt;/em&gt;and &lt;em&gt;Farm&lt;/em&gt;.&amp;nbsp; I would go into the difference in scopes, because this post is already getting long enough.&amp;nbsp; You will most likely use Site or Web for most things you do (&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/08/21/sharepoint-to-api-translation-guide.aspx"&gt;note on terms in API&lt;/a&gt;).&amp;nbsp; The &lt;em&gt;ElementManifest &lt;/em&gt;element makes calls to additional XML files.&amp;nbsp; Typically the other file is called Elements.xml (although it can be called anything).&lt;/p&gt; &lt;p&gt;The Elements.xml file can be used to deploy files, create document libraries, and many other functions.&amp;nbsp; I won&amp;#39;t go into the whole detail of this file (it&amp;#39;s in the SDK), but basically we are specifying that the &lt;em&gt;MyWebPart.webpart&lt;/em&gt; file should be copied into the web part gallery.&amp;nbsp; I will tell you what a few things are though.&amp;nbsp; In this case the Module element says that we are going to deploy something into a list that is located at &lt;em&gt;_catalogs/wp &lt;/em&gt;(this is the URL of the web part gallery).&amp;nbsp; How did I figure this out?&amp;nbsp; I looked at another example.&amp;nbsp; The File element deploys our MyWebPart.webpart file into the web part gallery.&amp;nbsp; I wont go into why you set the Type to &lt;em&gt;GhostableInLibrary&lt;/em&gt; right now.&amp;nbsp; Just know this is the value you will pretty much always use.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Elements&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Module&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;WebPartPopulation&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;List&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;113&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Url&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;_catalogs/wp&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;RootWebOnly&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;TRUE&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;File&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Url&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MyWebPart.webpart&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Type&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;GhostableInLibrary&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Module&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Elements&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;When the feature is activated, it will put the file in the web part gallery.&amp;nbsp; However, it won&amp;#39;t &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/03/04/reminder-delete-web-parts-from-gallery-when-changing-version-numbers.aspx"&gt;remove the item&lt;/a&gt; from the web part gallery on deactivation.&amp;nbsp; It&amp;#39;s pretty easy to do with code and I still plan to write a post on it.&amp;nbsp; For now, if you want the .webpart file gone you will have to delete it manually.&amp;nbsp; During the development cycle though, the only time it really is necessary to remove a .webpart file is if you have changed the namespace, class name, or public key token.&amp;nbsp; Here is what an elements file typically looks like for deploying a web part.&lt;/p&gt; &lt;p&gt;So where do all these files go?&amp;nbsp; Let&amp;#39;s talk about where you put them in your Visual Studio project first.&amp;nbsp; Typically, what you will do is create a folder structure in your project that matches the 12 hive.&amp;nbsp; So in this case, we will create a TEMPLATE\FEATURES folder.&amp;nbsp; We will then create a folder for our web part.&amp;nbsp; I am just calling it MyWebPart for now.&amp;nbsp; Here is what your solution will look like.&amp;nbsp; This folder is where you will put Feature.xml, Elements.xml, and MyWebPart.webpart.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/BacktoBasicsHowtoBuildandDeployaWebPart_E55A/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="244" alt="image" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/BacktoBasicsHowtoBuildandDeployaWebPart_E55A/image_thumb.png" width="238" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;To deploy the feature, copy it to the TEMPLATE\FEATURES folder in your 12 hive.&amp;nbsp; You then need to use stsadm command to install it.&amp;nbsp; The stsadm executable is located in the bin folder of the 12 hive.&amp;nbsp; You tend to use it a lot, so you might want to put it in your path environment variable.&amp;nbsp; Once you have located it, issue the following command.&lt;/p&gt; &lt;p&gt;&lt;em&gt;stsadm -o installfeature -name MyWebPart&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This makes the feature available to be activated.&amp;nbsp;&amp;nbsp; To activate it, go to Site Collection Features (Site Root -&amp;gt; Site Settings -&amp;gt; Site Collection Features).&amp;nbsp; Find the feature in the list and click the Activate button.&amp;nbsp; This deploys the web part to the gallery and it can be added to pages as before.&amp;nbsp; If you ever want to remove the feature, use the &lt;em&gt;uninstallfeature&lt;/em&gt; operation.&amp;nbsp; You will want to deactivate the feature first, otherwise you will have to use the -force parameter when using stsadm.&lt;/p&gt; &lt;h4&gt;Deploying Via Solution Package&lt;/h4&gt; &lt;p&gt;Features are nice, but we can take this one step further.&amp;nbsp; A solution package (.wsp file) allows you to package your entire solution into one .wsp file for deployment.&amp;nbsp; A .wsp file is simply a cab file with a manifest.xml file that tells SharePoint how to install the contents.&amp;nbsp; It will even deploy and install your feature for you, allowing you to skip the installation steps above.&amp;nbsp; Two files are required to build the .wsp file: cab.ddf and manifest.xml.&amp;nbsp; These files typically go into a folder called Solution in your Visual Studio project.&amp;nbsp; Cab.ddf tells the utility, makecab.exe, how to construct the .wsp file.&amp;nbsp;&amp;nbsp; Below is an example DDF file.&amp;nbsp; You will need to set the &lt;em&gt;CabinetNameTemplate&lt;/em&gt; to the filename you want for your wsp file.&amp;nbsp; You then specify a source and destination for each file you want copied.&amp;nbsp; In the example below, note that I am copying the DLL, Elements.xml, Feature.xml, and MyWebPart.webpart file.&amp;nbsp; &lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;; ** MyWebPart.wsp **&lt;/p&gt; &lt;p style="margin:0px;"&gt;.OPTION EXPLICIT&amp;nbsp;&amp;nbsp;&amp;nbsp; ; Generate errors &lt;/p&gt; &lt;p style="margin:0px;"&gt;.Set CabinetNameTemplate=MyWebPart.wsp&lt;/p&gt; &lt;p style="margin:0px;"&gt;.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory&lt;/p&gt; &lt;p style="margin:0px;"&gt;.Set CompressionType=MSZIP;** All files are compressed in cabinet files&lt;/p&gt; &lt;p style="margin:0px;"&gt;.Set UniqueFiles=&amp;quot;ON&amp;quot;&lt;/p&gt; &lt;p style="margin:0px;"&gt;.Set Cabinet=on&lt;/p&gt; &lt;p style="margin:0px;"&gt;.Set DiskDirectory1=Package&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;Solution\manifest.xml manifest.xml&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;; binary&lt;/p&gt; &lt;p style="margin:0px;"&gt;bin\debug\MyWebPart.dll MyWebPart.dll&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;; feature files&lt;/p&gt; &lt;p style="margin:0px;"&gt;TEMPLATE\FEATURES\MyWebPart\Elements.xml MyWebPart\Elements.xml&lt;/p&gt; &lt;p style="margin:0px;"&gt;TEMPLATE\FEATURES\MyWebPart\Feature.xml MyWebPart\Feature.xml&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;; web part files&lt;/p&gt; &lt;p style="margin:0px;"&gt;TEMPLATE\FEATURES\MyWebPart\MyWebPart.webpart FEATURES\MyWebPart\MyWebPart.webpart&lt;/p&gt;&lt;/div&gt; &lt;p&gt;I won&amp;#39;t go into manifest.xml again because I have already covered it once in this &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/04/more-on-manfiest-xml.aspx"&gt;post&lt;/a&gt;.&amp;nbsp; It&amp;#39;s this file that tells SharePoint how to deploy features, copy files, setup code access security, and add SafeControl entries to your web.config.&amp;nbsp; Once you create your solution files, build your project and then go to the command line.&amp;nbsp; The utility makecab.exe (should already be on your system) will actually create the wsp file.&amp;nbsp; In the command prompt, go to the root folder of your project and execute the following command.&amp;nbsp; It has to be executed from that folder because all of the paths are relative.&lt;/p&gt; &lt;p&gt;&lt;em&gt;makecab.exe /f solution\cab.ddf&lt;/em&gt;&lt;/p&gt; &lt;p&gt;You can automate this step when you build, by creating a &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/08/28/using-msbuild-to-create-a-sharepoint-wsp-file-on-build.aspx"&gt;build action&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;If you are working on a remote server, you will need to copy the .wsp file onto the server. Add and deploy the solution with the following commands.&lt;/p&gt;&lt;pre&gt;stsadm -o addsolution -filename package\MyAssembly.wsp
stsadm -o deploysolution -name MyAssembly.wsp -immediate -allContentUrls -allowGacDeployment
stsadm -o execadmsvcjobs&lt;/pre&gt;
&lt;p&gt;At this point if all goes well, your solution will be installed and deployed.&amp;nbsp; This eliminates all the steps of manually copying files into SharePoint.&amp;nbsp; You can then activate your feature like before (remember it installs the feature for you) and add your web part to a page.&amp;nbsp; If you make an update to your web part, deploying is easy, just use the &lt;em&gt;upgradesolution&lt;/em&gt; stsadm command and it will update all the files in your solution.&amp;nbsp; Should you decide, you don&amp;#39;t need the solution any more, use the &lt;em&gt;retractsolution&lt;/em&gt; command.&amp;nbsp; After you issue either of those commands, you will need to follow it up with a &lt;em&gt;execadmsvcjobs&lt;/em&gt; command as shown above.&lt;/p&gt;
&lt;p&gt;This may sound like a lot, but it really isn&amp;#39;t bad.&amp;nbsp; It makes deployment really easy (especially to other servers).&amp;nbsp; Once you have your solution deployed and you want to make an update, you can also just directly copy out the binary to your server.&amp;nbsp; Not really a best practice, but it does speed things up quite a bit, since stsadm commands take a few seconds to run.&lt;/p&gt;
&lt;p&gt;Once you get the hang of it and are familiar with the deployment process, you really need to consider deploying your solution to the bin folder by deploying your solution under partial trust.&amp;nbsp; Remember right now, you are deploying to the GAC which is not ideal.&amp;nbsp; My post on &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/07/05/how-to-configure-code-access-security-for-a-web-part.aspx"&gt;Code Access Security&lt;/a&gt; walks you through the whole process and provides more details on how solution packages are built.&lt;/p&gt;
&lt;h4&gt;User Controls&lt;/h4&gt;
&lt;p&gt;By now, you may be thinking, I went through all of that and I still have to render stuff to the screen using straight code?&amp;nbsp; I hear you.&amp;nbsp; It&amp;#39;s not any fun at all and can be a &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/08/04/to-web-part-or-not-to-web-part.aspx"&gt;controversy&lt;/a&gt; among some SharePoint developers.&amp;nbsp; You do have a couple of alternatives, use the &lt;a href="http://www.codeplex.com/smartpart"&gt;SmartPart&lt;/a&gt; or &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/07/30/how-to-build-your-own-smartpart-control.aspx"&gt;write your own&lt;/a&gt;.&amp;nbsp; I typically go with the latter.&amp;nbsp; This simple web part uses Page.LoadControl to load the .ascx file you specify. &lt;/p&gt;
&lt;p&gt;This is quickly becoming the longest post I have ever written.&amp;nbsp; I&amp;#39;ve attached the code I used in this post.&amp;nbsp; You can use it to verify that you put your own web part together correctly or you can use it as a starting point.&amp;nbsp; I hope this provides enough information for a new SharePoint developer to get started.&amp;nbsp; I certainly wish I had this much info condensed in one place when I was starting out.&amp;nbsp; You may also want to check out one of the many solution generating tools out there such as &lt;a href="http://www.codeplex.com/stsdev"&gt;stsdev&lt;/a&gt;.&amp;nbsp; Please leave a comment if this helps or if you have any questions.&amp;nbsp; If I am missing anything or you think I need to add anything, also please let me know.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=751" width="1" height="1"&gt;</description><enclosure url="http://www.dotnetmafia.com/blogs/dotnettipoftheday/attachment/751.ashx" length="25753" type="application/x-zip-compressed" /><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Feature/default.aspx">Feature</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Code+Access+Security/default.aspx">Code Access Security</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/WebPart/default.aspx">WebPart</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Solution/default.aspx">Solution</category></item><item><title>SharePint Tonight!</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/16/sharepint-tonight.aspx</link><pubDate>Thu, 16 Oct 2008 18:55:25 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:748</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Just a reminder about tonight&amp;#39;s &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/24/announcing-the-first-tulsa-sharepint-meetup.aspx"&gt;SharePint meetup&lt;/a&gt; at Crawpappy&amp;#39;s.&amp;nbsp; Officially starts at 6, but we&amp;#39;ll probably be there early.&amp;nbsp; This will be a great opportunity to talk to other members of the SharePoint community here in Tulsa.&amp;nbsp; I don&amp;#39;t expect it to be as wild as &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/10/beer-and-code-meetup-was-a-huge-success.aspx"&gt;Beer and Code&lt;/a&gt;, but it should still be a good time.&amp;nbsp; We&amp;#39;ll see you there!&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=748" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Meetup/default.aspx">Meetup</category></item><item><title>My 500th Post! Left Outer Joins with LINQ</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/15/my-500th-post-left-outer-joins-with-linq.aspx</link><pubDate>Wed, 15 Oct 2008 19:43:46 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:743</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Today, this blog reaches an important milestone.&amp;nbsp; This is my 500th post.&amp;nbsp; It&amp;#39;s just a number, but I thought I would use it as an opportunity to talk about the history of the blog and where it is heading.&amp;nbsp; On December 1st, 2004, I wrote my first .NET Tip of the Day about a great new method on primitives called &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2004/12/01/tryparse-is-a-good-time.aspx"&gt;TryParse&lt;/a&gt; in the upcoming release of ASP.NET 2.0.&amp;nbsp; This blog started out as a simple announcements list built on a SharePoint intranet site so that I could educate a team of developers on emerging technology (at the time it was .NET 2.0 and SQL Server 2005).&amp;nbsp; When I left that company, I wanted to keep the concept going so I exported all of the content and created a home-grown blogging engine at &lt;a href="http://www.dotnettipoftheday.com"&gt;dotnettipoftheday.com&lt;/a&gt;.&amp;nbsp; Since then, I have been committed to giving back to the community by providing useful information that will help developers do their every day jobs.&amp;nbsp; My blog has always focused on how to do something not to give my opinion on something that I may or may not know anything about.&amp;nbsp; Admittedly, I haven&amp;#39;t been able to keep up with the daily thing of posting (although I did a pretty good job back then), but I still make an effort to post a few things a week.&lt;/p&gt; &lt;p&gt;Sometime in 2007, the term DotNetMafia was coined by the godfather himself &lt;a href="http://www.dotnetmafia.com/blogs/kylekelin/default.aspx"&gt;Kyle Kelin&lt;/a&gt;.&amp;nbsp; Although the original idea for the mafia has evolved, it turned out to be a great way to get blogs from several of us onto one web site, &lt;a href="http://www.dotnetmafia.com/"&gt;dotnetmafia.com&lt;/a&gt;, which ran on DotNetNuke.&amp;nbsp; The site worked ok for us for a while, but it was lacking.&amp;nbsp; Later that year, I imported everything (well almost everything) into a new Community Server site where we are today.&amp;nbsp; In case you haven&amp;#39;t seen the rest of the DotNetMafia bloggers, be sure and check out &lt;a href="http://www.dotnetmafia.com/blogs/anthonykilhoffer/default.aspx"&gt;Tony Kilhoffer&lt;/a&gt;, &lt;a href="http://www.dotnetmafia.com/blogs/jamesashley/default.aspx"&gt;James Ashley&lt;/a&gt;, &lt;a href="http://www.dotnetmafia.com/blogs/coryrobinson/default.aspx"&gt;Cory Robinson&lt;/a&gt;, and &lt;a href="http://www.dotnetmafia.com/blogs/kevin/default.aspx"&gt;Kevin Williams&lt;/a&gt;.&amp;nbsp; They post on a variety of topics (including some outside of .NET).&lt;/p&gt; &lt;p&gt;In nearly 4 years, I have brought you 500 posts.&amp;nbsp; 112 of those posts have been on SharePoint.&amp;nbsp; Obviously you can see that I have shifted focus some.&amp;nbsp; The main reason is I blog about the things I am working with on a daily basis.&amp;nbsp; Right now, that has been SharePoint.&amp;nbsp; Although I still find time to blog about LINQ and other things from time to time.&amp;nbsp; Let&amp;#39;s face it though, the SharePoint community needs all the help it can get.&amp;nbsp; Sites like &lt;a href="http://www.sharepointblogs.com"&gt;SharePointBlogs.com&lt;/a&gt; (which this feed is syndicated too), have made a huge difference in helping people find the right information.&amp;nbsp; This is why I am committed to posting every nuance I find in the product, so that the next SharePoint developer coming along doesn&amp;#39;t have to spend time trying to figure it out.&lt;/p&gt; &lt;p&gt;I am pleased with how the site has grown to date.&amp;nbsp; In four years, we have gone from having a couple of internal users a month, to 200 - 300 unique visitors a day.&amp;nbsp; 65% of that traffic each day comes from search.&amp;nbsp; The rest are from RSS subscriptions, referrals, and my &lt;a&gt;CodePlex project&lt;/a&gt;.&amp;nbsp; For now, I plan to keep the content coming and encourage others to blog too.&amp;nbsp; I am committed to helping the community even more and hope to continue to grow the site and organize meetups.&amp;nbsp; I want to thank all of my friends, all two of my readers, &lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;Copy Source as HTML&lt;/a&gt;, and everyone that has left a comment.&amp;nbsp; I really appreciate it.&lt;/p&gt; &lt;p&gt;Enough fluff for now though, let&amp;#39;s get to some content.&amp;nbsp; I am going to step away from SharePoint for today&amp;#39;s post and try to hit a broader audience talking about LINQ.&lt;/p&gt; &lt;h3&gt;Left Outer Joins with LINQ&lt;/h3&gt; &lt;p&gt;The topic I am talking about today is doing left outer joins with LINQ.&amp;nbsp; Doing a join in LINQ is pretty simple, however doing an outer join is a bit more tricky because the way you do it doesn&amp;#39;t follow the way you would think of it using T-SQL.&amp;nbsp; The documentation on LINQ covers how to do this, but it doesn&amp;#39;t do a great job explaining what you are doing and why.&amp;nbsp; For this example let&amp;#39;s say we have two classes &lt;em&gt;Product&lt;/em&gt; and &lt;em&gt;Inventory&lt;/em&gt;.&amp;nbsp; The Product class has the following properties Name, ProductId, and Price.&amp;nbsp; The Inventory class has the properties ProductId and Count.&amp;nbsp; We want to get a list of all products and know how many we have in inventory but unfortunately the Inventory table isn&amp;#39;t complete and it doesn&amp;#39;t have data on all products.&amp;nbsp; We still want the product to return in a query though.&lt;/p&gt; &lt;p&gt;First, for the purpose of example, I populate two lists.&amp;nbsp; This could just as easily come from an XML document or SQL.&amp;nbsp; In this case we have three products and two items containing inventory, but info is missing for one particular product.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;&amp;gt; productList = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;&amp;gt;();&lt;/p&gt; &lt;p style="margin:0px;"&gt;productList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;() { Name = &lt;span style="color:#a31515;"&gt;&amp;quot;Product 1&amp;quot;&lt;/span&gt;, Price = 10.99f, ProductId = 2 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;productList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;() { Name = &lt;span style="color:#a31515;"&gt;&amp;quot;Product 2&amp;quot;&lt;/span&gt;, Price = 1.99f, ProductId = 5 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;productList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;() { Name = &lt;span style="color:#a31515;"&gt;&amp;quot;Product 3&amp;quot;&lt;/span&gt;, Price = 3.99f, ProductId = 9 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;&amp;gt; inventoryList = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;&amp;gt;();&lt;/p&gt; &lt;p style="margin:0px;"&gt;inventoryList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;() { ProductId = 2, Count = 54 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;inventoryList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;() { ProductId = 9, Count = 31 });&lt;/p&gt;&lt;/div&gt; &lt;p&gt;If this was a T-SQL query it would probably look something like this:&lt;/p&gt; &lt;p&gt;&lt;em&gt;SELECT p.Name, i.Count FROM Products p LEFT OUTER JOIN Inventory i ON p.ProductId = i.ProductId&lt;/em&gt;&lt;/p&gt; &lt;p&gt;In LINQ it is going to look a bit different though.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; productInventory = &lt;span style="color:blue;"&gt;from&lt;/span&gt; product &lt;span style="color:blue;"&gt;in&lt;/span&gt; productList&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;join&lt;/span&gt; inventory &lt;span style="color:blue;"&gt;in&lt;/span&gt; inventoryList&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;on&lt;/span&gt; product.ProductId &lt;span style="color:blue;"&gt;equals&lt;/span&gt; inventory.ProductId &lt;span style="color:blue;"&gt;into&lt;/span&gt; productInventoryGroup&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;from&lt;/span&gt; item &lt;span style="color:blue;"&gt;in&lt;/span&gt; productInventoryGroup.DefaultIfEmpty(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;() { ProductId = product.ProductId, Count = 0 })&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;select&lt;/span&gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name = product.Name,&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductId = product.ProductId,&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count = item.Count&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;/div&gt; &lt;p&gt;The first thing we do is get a reference to an instance of the class (&lt;em&gt;product&lt;/em&gt;) out of the &lt;em&gt;productList&lt;/em&gt; with the from clause.&amp;nbsp; We then can join that to the &lt;em&gt;inventoryList.&amp;nbsp; &lt;/em&gt;Remember in LINQ, you always have to have a reference to the class itself and not the collection when performing join and where operations, so we also get a reference to an instance of the class (&lt;em&gt;inventory&lt;/em&gt;).&amp;nbsp; Once we have that we can use the on clause to relate the two lists using the &lt;em&gt;ProductId &lt;/em&gt;field.&amp;nbsp; When doing a join you must use the keyword &lt;em&gt;equals&lt;/em&gt; to relate the two collections.&lt;/p&gt; &lt;p&gt;Here is where things really differ from what you may be used to.&amp;nbsp; The first thing that is different is that the result of the join is stored in a new variable using the into clause (in this case &lt;em&gt;productInventoryGroup&lt;/em&gt;).&amp;nbsp; This is because in LINQ you use the &lt;em&gt;DefaultIfEmpty()&lt;/em&gt; method to specify default values to return when there are no matching values on the right side of the join.&amp;nbsp; You can specify no parameter on this method to use the default when it is empty (usually null or 0 for an int), or you can pass a value for it to use.&amp;nbsp; In this case I created a new instance of Inventory and set &lt;em&gt;Count&lt;/em&gt; to 0.&amp;nbsp; You then use another from clause to reference an item from that join.&amp;nbsp; Once you get to this point, it is just a matter of creating a new anonymous type, with product.Name and item.Count as values.&amp;nbsp; Remember, item in this case is of type Inventory and will contain the value from that list or the default if there is no match.&lt;/p&gt; &lt;p&gt;You can then iterate through the result of the join like usual.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; item &lt;span style="color:blue;"&gt;in&lt;/span&gt; productInventory)&lt;/p&gt; &lt;p style="margin:0px;"&gt;{&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515;"&gt;&amp;quot;{0}: {1}&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;, item.Name, item.Count));&lt;/p&gt; &lt;p style="margin:0px;"&gt;}&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Which would return the following results.&lt;/p&gt;&lt;pre&gt;Product 1: 54
Product 2: 0
Product 3: 31
&lt;/pre&gt;
&lt;p&gt;It really isn&amp;#39;t that bad, but it&amp;#39;s just different than what you might be used to coming from the T-SQL world.&amp;nbsp; Hopefully, this explanation helps and will be of use to you.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Of course, don&amp;#39;t forget that tomorrow night is the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/24/announcing-the-first-tulsa-sharepint-meetup.aspx"&gt;SharePint meetup&lt;/a&gt; at CrawPappy&amp;#39;s at 6:00pm.&amp;nbsp; Thanks again.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=743" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category></item><item><title>Real World Dojo part Two: File Upload</title><link>http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/15/742.aspx</link><pubDate>Wed, 15 Oct 2008 06:05:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:742</guid><dc:creator>JamesAshley</dc:creator><slash:comments>0</slash:comments><description>The basics of using the new file uploader...(&lt;a href="http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/15/742.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=742" width="1" height="1"&gt;</description><enclosure url="http://www.dotnetmafia.com/blogs/jamesashley/attachment/742.ashx" length="2843" type="text/html" /><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/coding/default.aspx">coding</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/Not+Dot+Net/default.aspx">Not Dot Net</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/javascript/default.aspx">javascript</category></item><item><title>Real World Dojo part One: Form Validation</title><link>http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/14/741.aspx</link><pubDate>Tue, 14 Oct 2008 22:18:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:741</guid><dc:creator>JamesAshley</dc:creator><slash:comments>0</slash:comments><description>Real World Dojo, part One (Basic Validation) The Scenario: I’ve kind of been nibbling around the edges of Dojo for a while, but I’m at a place in this project where I really need to buckle down and learn it. Since I’m having so much trouble finding real-life examples of the basics, I figured I’d share what I’m coming across. I have a very simple proof-of-concept form that shows the basics of the one that forced me to buckle down. It looks like this: &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;Validation Test (raw...(&lt;a href="http://www.dotnetmafia.com/blogs/jamesashley/archive/2008/10/14/741.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=741" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/coding/default.aspx">coding</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/Not+Dot+Net/default.aspx">Not Dot Net</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/open+source/default.aspx">open source</category><category domain="http://www.dotnetmafia.com/blogs/jamesashley/archive/tags/javascript/default.aspx">javascript</category></item><item><title>Wildcard Search Version 1.0 Release 3</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/14/wildcard-search-version-1-0-release-3.aspx</link><pubDate>Tue, 14 Oct 2008 21:46:09 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:740</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://www.codeplex.com/WildcardSearch/Release/ProjectReleases.aspx?ReleaseId=18345"&gt;Release 3&lt;/a&gt; of the Wildcard Search Web Part is now available.&amp;nbsp; This minor update fixes a user reported issue where the scope property was not being used.&amp;nbsp; If you are new to the blog, the Wildcard Search web part allows a user to do partial word queries with Enterprise Search (i.e.: searching for red, returns results matching redmond, redding, and red).&amp;nbsp; Please continue to report bug on the &lt;a href="http://www.codeplex.com/WildcardSearch"&gt;CodePlex&lt;/a&gt; site.&amp;nbsp; Thanks again for everyone&amp;#39;s input.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Also, don&amp;#39;t forget the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/24/announcing-the-first-tulsa-sharepint-meetup.aspx"&gt;SharePint meetup&lt;/a&gt;, this Thursday at Crawpappy&amp;#39;s at 6pm.&amp;nbsp; &lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=740" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx">Enterprise Search</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Wildcard+Search/default.aspx">Wildcard Search</category></item><item><title>Tulsa TechFest 2008 - Another Good Turnout</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/13/tulsa-techfest-2008-another-good-turnout.aspx</link><pubDate>Mon, 13 Oct 2008 21:26:38 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:739</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Last week, I attended and spoke at &lt;a href="http://techfests.com/Tulsa/2008/default.aspx"&gt;Tulsa TechFest&lt;/a&gt;.&amp;nbsp; This year had a pretty good turnout thanks to &lt;a href="http://www.davidlwalker.com/"&gt;David Walker&lt;/a&gt; and all of his volunteers..&amp;nbsp; With 17 tracks, it is no wonder, this event is reportedly one of the largest community organized tech events.&amp;nbsp; Even cooler that it&amp;#39;s in Tulsa, OK.&amp;nbsp; Not only did it bring in people from Tulsa, but it also attracted people from Texas, Arkansas, Kansas, and Missouri (and probably other places - those are just the places that I met people from).&amp;nbsp; I decided to mix it up this year and check out some sessions other than the SharePoint ones.&amp;nbsp; I caught &lt;a href="http://www.dotnetmafia.com/"&gt;DotNetMafia&amp;#39;s&lt;/a&gt; own &lt;a href="http://www.dotnetmafia.com/blogs/kylekelin/default.aspx"&gt;Kyle Kelin&amp;#39;s&lt;/a&gt; talk on &lt;a href="http://www.dotnetmafia.com/blogs/kylekelin/archive/2008/10/08/speaking-on-jquery-tomorrow-at-tulsa-techfest.aspx"&gt;jQuery&lt;/a&gt; along with &lt;a href="http://www.phatboyg.com/"&gt;Chris Patterson&amp;#39;s&lt;/a&gt; talk on iPhone development.&amp;nbsp;&amp;nbsp; I also caught &lt;a href="http://developingux.com/"&gt;Caleb Jenkin&amp;#39;s&lt;/a&gt; talk on Silverlight with Visual Studio 2008.&amp;nbsp; I have to say Caleb has the best looking slide deck of any presenter I have ever seen.&amp;nbsp; No idea how he does it.&lt;/p&gt; &lt;p&gt;Of course, I did hang out in the SharePoint room as much as possible.&amp;nbsp; I was the first speaker in the room and did my new session on &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/08/slides-and-