Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Derik Whittaker

Thoughts on Software Development, .Net, OOP, Design Patterns and all things cool

August 2007 - Posts

  • Hacking the GAC, How to enable standard directory browsing

    Have you ever wanted to or needed to view the actual contents of the GAC?  Not just what is in the GAC, but actually grab the assemblies that are there? 

    I know I have.  You may be asking WHY did you want to grab an assembly that is in the GAC.  2 reasons:

    1. I wanted to move a copy of the assmebly from one box onto my dev box.
    2. I wanted to reflect the the assembly to see how it was build to learn something.

    Well, fortunately there is a way to do this.  It is a pretty simple registry hack that works wonders.

    Here is how:

    1. Open RegEdit
    2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
    3. Right click in the viewer and add a new Binary Value
    4. Name your new Binary value DisableCacheViewer
    5. Double click your new entry and given it a value of 1 with Base Hexadecimal
    6. Click OK
    7. Navigate to C:\WINDOWS\assembly
    8. You should see the contents of the folder as sub folders, not the standard GAC Viewer

    Hope this helps..... I would be sure to delete or rename this new value AFTER you are done playing around.

    **** WARNING **** Any time you modify your registry, you do so at your OWN risk. 

    Till next time,


    kick it on DotNetKicks.com
  • Sharepoint Web Part Gallery Configuration Gotcha

     In order to add a new web part to Sharepoint 2007 (MOSS) you need to add the assembly information to the <SafeControl> list inside the sites Web.Config file.  When doing so make sure to type carefully.  If you make a mistake when editing the config file, the page will not render correctly. If the page is NOT rendering correctly for you, check the Application Event log for details, this may point you in the right direction.

    Pay special attention to the casing for the attributes.  They ARE case sensitive. 

    Invalid (namespace is not cased correctly):
    <SafeControl Assembly="xxxx, Version=1.0.0.0, Culture=neutral" namespace="xxx" TypeName="*" Safe="True" AllowRemoteDesigner="True" />

    Valid (namespace is not cased correctly):
    <SafeControl Assembly="xxxx, Version=1.0.0.0, Culture=neutral" Namespace="xxx" TypeName="*" Safe="True" AllowRemoteDesigner="True" />

    Just thought I would say my findings/pain with everyone.

    Till next time,

     

     

    kick it on DotNetKicks.com
  • A Nice 2 Part series on getting started with SharePoint (MOSS) 2007 from MSDN

    Over at MSDN there is a nice 2 part series about getting started in developing SharePoint (MOSS) 2007 solutions/add-ins.  These 2 articles are well worth the read for any newbie (like myself) and I would highly recommend reading them.

    They can be found here:
    Part 1
    Part 2

    Till next time,
     

  • New SharePoint 2007 SDK Released

    Recently (on 8/22) Microsoft released their latest SharePoint 2007 SDK.  This new SDK has a ton of new stuff along with more/better documentation.

    You can get the new SDK from here.

    Here is a overview of what is new in this version of the SDK:

  • New tools and samples included with the MOSS SDK: Developer tools and samples for the following areas of MOSS development (new items in bold):
    • Business Data Catalog Samples and Utilities
      • Microsoft Business Data Catalog Definition Editor
      • Sample Pluggable SSO Provider
      • WSHelloWorld Web Service
      • WSOrders Web Service
      • Excel Services User Defined Function Sample
      • WSOrders Custom Proxy Sample
      • Amazon Web Service Sample
      • AdventureWorks Metadata Samples
      • SAP Sample
    • Document Management and Content Processing Samples
      • Comment Scrub Document Converter
      • Term Replacement Document Inspector
    • Search Samples
      • Sample Protocol Handler
      • Custom Content Source
    • Records Management and Policy Samples
      • De-Duplication Router
      • Document Integrity Verifier
      • Records Center Web Service Console Application
      • Search, Collect, and Hold Tool
      • Sample Custom Barcode Generator
      • IRM Document Protector
    • Workflow Samples
      • Custom Workflow Report Query Generator
      • Custom Workflow Report XLSX Injector
      • Visual Studio Workflow Templates
      • Enterprise Content Management Workflow Activities
      • List Item Activities
      • Hello World Sequential Workflow
      • State Based Approval Workflow
      • Modification Workflow
      • Replication and Contact Selector Workflow
      • Intersystem Purchase Order
      • Confidential Approval Workflow
      • Group Approval Workflow
      • Approval Workflow Sample
      • Multi-Stage Workflow
      • Server-side Collect Signatures Workflow
  • Till next time,


    kick it on DotNetKicks.com
  • Retrieving List Information in Share Point

    One common tasks that I have needed to do while working with SharePoint 2007 (MOSS) is to retrieve information in regards lists or libraries.  You need this information when you want to perform add, update, or delete functions when working with data from a document library. 

    In today's post I will walk you though retrieving the list information.  We will be getting this list information via the Lists.asmx web service.

    Like I said above, this is a common task for me, so I have made this a utility style method.  You will notice that I pass in 2 different parameters into this method.  The first one is an enumeration value that contain the names of my different sites/sub-sites.   The second one is the name of the document library that I an want to work with.

    Code to pull out the list information:


    Code below is called by the code above to build us a valid instance of the web service.  This method here is public because it is actually part of another class.  The Lists return type is an instance of the Webservice object.


    Code Explained

    1. First thing we need to do is build a connection to the web service
    2. Once we have our web service instance we need to connect to the service via the GetLists method.  This will return an XmlNode object for use.
    3. After we have the XmlNode return value from the GetList method we need to pull out the ID and Version values.  To take a look at all the possible values/data that is returned via the GetList method simply do a listResponse.OuterXml call on the listResponse XmlNode.
    4. Lastly we build an instance of my ListDataInformation object.  This object is a simple object with 3 properties that hold the ID, name and version.

    Here you have it, a pretty simple and straight forward way to retrieve different information about your Sharepoint List.

    Till next time,

    kick it on DotNetKicks.com
  • Tafiti, Microsoft's live.com search engine with Silverlight

    Microsoft has put a new face on their search engine at live.com.  This new face was written in Silverlight, and is a pretty cool example of what can be done with this new product.

    Check it out at http://www.tafiti.com/

    Till next time,

  • Standard questions to be asked when logging bugs

    In my last post (here) I spoke about different do’s and don’ts when it comes to logging bugs.  What I really did not hit on was the different types of questions I feel should be asked when logging bugs.

    Here are my questions, in no particular order.

    • Platform
    • Application Version #
    • Environment
    • Title
    • Short Description
    • Details Steps
    • Data used during testing
    • Module/Sub Subsystem (if applicable)
    • Is Reproducible
    • Screen Shot (if applicable)
    • Attachments ( if applicable)

    The above is the list of data I think is valuable in order to property address and fix bugs. 

    Did I miss any?

    Till next time,


    kick it on DotNetKicks.com
  • Really cool (and free) xml/xpath evaluator tool

    In one of my prior post there was a comment by the author of SketchPath.  I thought I would give his product a spin to see if it meet my needs. I did, and it is really nice.  Many times I need to test xPath statements, but doing so in code is just tedious.  This tool is free and it is real simple to use.

    Give it a look at here.

    Till next time,

     

  • Logging Bugs: Do's and Don'ts

    All software that is being developed WILL have bugs, sorry, but this IS a fact.  Now I know some people and companies don't like to call them glitches in software bugs.  They would rather call them issues or defects.  For all I care we can call them 'WizBangs', just call them something and LOG THEM.

    However, logging 'WizBangs' (ok, I will call them bugs from here on) is not as simple as it may sound.  I would like to go over some of MY Do's and Don'ts in this post.  If you don't like my list, or would like to add to it, drop me a line.

    When to log Items:

    • Do log everything.  Just because the bug may seem trivial or simple or only happen 'every now and again' does not mean that it should be ignored.  Even it you are not sure it is an issue, LOG IT.  Better to have close off an non-issue then fail to report a major bug in hiding
    • Don't assume that someone else is going to fix the issue.  Also, don't assume this issue is too trivial or minor to report.  Wouldn't it suck to find out after the application went lived that you failed to report a critical bug because you thought it was not a 'big deal'?

    Providing information on the log:

    • Do provide detailed information about the bug.  Save yourself the headache later and provide as much information as you possible can.  This should include, but not limited to items such as Build Version, Environment, Platform, Short Description of issue, Severity, Detailed steps to reproduce.
    • Don't make provide a single sentence that says something like 'Unable to perform XYZ in the ABC process'.  This type of information will provide nothing of real value to the next guy.  Sure, this would be a great line for the title of the bug.  But by no means is this enough information to fix the bug.

    What types of items to log:

    • Do Log Everything.  Enough said
    • Don't make assumptions

    When to log bugs:

    • Do log them as soon as possible.
    • Don't put it off.  If you dont log the bug as soon as you find it you WILL forget something about what you did to cause it.  For the sake of your fellow co-workers log it now before you forget.

    The plain and simple truth about logging bugs is, it sucks!!!!  However, it is a necessary part of most developers jobs.  If you take some time and put in a little effort, you will be rewarded with great riches.  Ok, maybe not great riches, but it will make fixing the bugs much easier.

    Till next time,


    kick it on DotNetKicks.com
  • Name of a good ASP.Net web host

    I am looking for suggestions on a good ASP.net web host.  I am looking for shared hosting.  I have used Webhost4Life before and was happy, but would like to get everyone's feedback.

    Thanks,

    Till next time,

  • New Release of Rhino Mocks

    As you may or may not know, I am a huge fan of Rhino Mocks.  Well Ayende has put out Rhino Mocks 3.2 today.

    Check out more information on it here.

    You can download it here.

  • Creating your first WSS/Sharepoint Web Part

    In WSS 3.0, the creation of web parts is easier than ever.  Since WSS 3.0 is fully based on and built around ASP.Net 2.0 you can leverage the .net framework to do your heavy lifting.

    Today I thought I would create a simple post on how to create your very first web part.  If you want a more in-depth how-to, please see the Links section below for more information.

    Getting Started:

    1. Create a new VS 2005 project
    2. Reference the System.Web namespace in your project
    3. Create a new class and have it inherit off of WebPart
      public class SimpleWebPart : WebPart

    4. Override the Render class, add a add the following line
      writer.Write("Hello, my first web part");

    5. Compile your web part.
    6. Copy your webpart to the bin directory on your WSS web server found here on my server
      C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin

    7. Open the web.config file to change the trust level of the site to WSS_Medium
    8. Add your assembly to the SafeControl list (I would copy an existing one and modify it)
      NOTE *** If you have not signed your assembly you can remove the PublicKeyToken attribute ***

    9. Open up a web browser and navigate to http://<<YourServerNameHere>>/_layouts/newdwp.aspx
      If you made the correct settings to the Web.Config file you should see your webpart in the list.

    10. Select your new web part and click Populate Gallery.  This will create the needed config file for your webpart.
    11. Now go to your sharepoint site and add the new web part.
      • Open a WSS list in edit mode
      • Click add web part
      • Select your new web part and add it to the list.

        12  Enjoy your new web part.


    I know this is just the tip of the ice berg, but you have got to start someplace.

    Links

    • More In-depth how-to - here
    • Web Part Control Set Overview - here
    • Creating web parts in WSS - here

    Till next time,

    kick it on DotNetKicks.com
  • Finally built-in Disk Partitioning in Microsoft Vista

    Today I finally broke down and bought a new PC, of course it came with MS Vista.  One of the first things I do anytime I get a new PC is setup my different partitions.  Normally I have to install something like partition magic in order to do this.  However, finally, with Vista M.S. has built in a disk partitioning utility.  Yea......

    Sorry, I know this is a bit off topic.  It just amazes me that it took MS this LONG to add this feature to their OS's.

    Till next time.

  • Renaming Issue with a Site Column in Sharepoint

    One of the features with Sharepoint (WSS 3.0 is what I am speaking about) is the ability to create ‘site columns’ for use in your site.  A site column is basically a data column that can be shared across all libraries/sub sites within your Sharepoint site.  This is a really nice feature, but beware as potential trouble is around the turn.

    How so, turns out that whatever name you give the column upon initial saving is the one it keeps.  Sharepoint keeps an internal name and a display name (key, value pair).  You always see the display value, not the key.

    For example, you create a column called ‘Red Bell’ and you save it, then you notice you misspelled the name and you change it to ‘Red Bull’.  You save your changes and go along on your marry way.  What you did not notice is that the actual ‘key’ did not change, just the display value.  Now, if you are NEVER going to be creating custom web parts, or using the API (via assemblies or web services) this should not be an issue for you.  However, if you do plan to do any custom development against Sharepoint, this may be an issue.

    How to find out the ‘real’ name of the column? Simple, just look in Sharepoint and you can find it.  Bad news is, that to the best of my ability there is NO screen that will actually show it to you.

    Here is how to get the real name

    1. Navigate to the Site Column Gallery
    2. Click on the column you are looking for
    3. Check the URL, yup, you read that right.  Check the URL

    The real column name is in the URL
    …/fldedit.aspx?field=CheckNumber&Source=%2F%5Flayouts%2Fmngfield%2Easpx….

    The CheckNumber field is one word, but in my Site Column Gallery it is Check Number.

    Hope this helps someone, I know I was pulling my hair out trying to understand why my web service calls worked for all columns but this one.

    Till next time

  • Sharepoint Services Gotcha, Field names with Whitespaces

    Today I ran into a pesky little issue when trying to query documents from sharepoint. In a previous example I talked about how to query documents from sharepoint, but what I did not know at the time is that if you have a field name that has a whitespace, you have to do some extra work.

    If you have a field named ‘FooField’ all is good, however if you have a field named ‘Foo Field’ (notice the whitespace) you will get the following exception.
    {System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> One or more field types are not installed properly. Go to the list settings page to delete these fields. ---> One or more field types are not installed properly. Go to the list settings page to delete these fields.

    To resolve this issue replace the whitespace with _x0020_ so the new field name would be ‘Foo_x0020_Field’.

    Hope this helps someone.

    Till next time

    Thanks to Tangible Thoughts for showing me the solution to this – post found here.

More Posts Next page »

Our Sponsors

Red-Gate!