Jun18

Some Fun Web Part Errors from Today

So, many issues I had to resolve today were typical over-rushed developer stuff: non checking for nulls, not testing with users that don’t have MySites, yadda yadda.

 

Two errors stood out as things I'd like to help people avoid doing.

 

First, the developer of the web parts I am fixing failed to make a distinction between System.Web.UI.WebParts.WebPart and Microsoft.SharePoint.WebPartPages.WebPart. They are almost identical, but each implements Web Part Properties in code slightly differently.

using com = System.ComponentModel;
using aspnetwebparts = System.Web.UI.WebControls.WebParts;
using wsswebparts = Microsoft.SharePoint.WebPartPages;

...

// for System.Web.UI web parts
[aspnetwebparts.Personalizable(aspnetwebparts.PersonalizationScope.Shared)]
[aspnetwebparts.
WebBrowsable(false)]
[com.
Category("Configuration")]
[aspnetwebparts.
WebDisplayName("Parent Category ID")]
[aspnetwebparts.
WebDescription("Determines the Parent Category from the Categories List on the Taxonomy Administration site")]

// for WSS web part
[wsswebparts.WebPartStorage(wsswebparts.Storage.Shared)]
[com.
Browsable(false)]
[wsswebparts.
SPWebCategoryName("Configuration")]
[com.
DisplayName("Parent Category ID")]
[com.
Description("Determines the Parent Category from the Categories List on the Taxonomy Administration site")]

This was probably a copy-pasta error, but he used the System implementation instead of the SharePoint one. As a result, none of these web part properties actually showed up where users could change them.

 

To be honest, I used to make this mistake all the time, especially when copying properties from other web parts I had written. These days, I just suck it up and define all of the attributes so I don't have to deal with this issue.

 

That was actually good news, because it means that maybe with a little more work, this solution will be about 10x as configurable as it is now.

 

The second thing almost drove me crazy, because it was very similar to a problem I saw a year ago (or more) and I couldn’t remember what it was. It turned out in the end this was a slightly different issue, but I digress. The problem was that when you have a Tool Pane Editor (basically a fancy custom Web Part Property) and it is used to set a WPP that’s also visible in the browser, the WPP will overwrite the changes that the TPE makes. So for example, you pick "IT Apps" in a dropdown TPE. The TPE goes and looks up the List ID for "IT Apps", and comes back with “15” and saves that to the WPP called Parent ID, but since Parent ID is also visible in the web page and has a value of “” (empty) the empty value then overwrites the “15” and you’re back where you started. The solution here is to hide the WPP by setting Browsable/WeBrowsable = false, thus proving it’s not how much code it takes to fix a bug but finding the correct line to change. J

 

To the developer's credit, I was the one who set this to true, because I was trying to make it visible so I could troubleshoot the ToolPane picker. Oops!

 

(By the way Ted, I hope you're settling in nicely at DOE. <grin>)

Published: Jun-18-09 | 0  Comment | 0  Link to this post

May19

Corrupted Blog Category Page

Symptoms: After a user has changed the system generated view and/or Posts web part. You may see more than one Posts web part. You may also see that clicking the links in the Categories listed along the left hand side of the page no longer produces filtered results, or returns no results where they are expected.

 

WARNING: Do not try this unless you are completely unafraid of messing everything up and having to move your blog content to a completely new site/list.

 

Solution:  Determine which of the multiple Posts web parts are behaving correctly. If some web parts have been closed, you may need to do this using SharePoint Designer. Reopen all closed Posts web parts by right clicking and selecting Web Part Properties, then uncheck the Close Web Part box in Appearance section. If any Posts web part behaves correctly, you may safely delete (do not close) the other web parts.  To remove web part customizations, save the page, then right click and Revert to Site Definition. In some situations, if the user has deleted the functional version of Posts web part, this solution may not work.

 

Recommended Future Action: Designers/users should make a copy of Categories.aspx and work with the copy to determine their changes do not have negative effects before implementing those changes on the system generated pages.

Published: May-19-09 | 0  Comment | 0  Link to this post

Mar31

Import Hyperlinks with Text into SharePoint Lists Using Excel

Suppose you have a list of URLs that your client has given you. Now suppose they also have stored the text for each URL in a seperate column alongside the URL. At first it might seem difficult to get this into a Hyperlink field on a SharePoint list, especially since the UI for the Datasheet view does not allow for each updates to these two pseudo-sub-fields seperately. You might be tempted to enter them both as simple text fields and use a calculated field and a data view (or some other nonsense) to get what you want. Don't, because it's actually quite easy.
 
Instead, bring your columnar data into Excel. Then in a blank column, use the HYPERLINK(url, text) formula to generate the links. Reference the calls to each column respectively within the formula. When you copy these into a SharePoint datasheet view, the text of the links will be preserved. Violla!
Published: Mar-31-09 | 2  Comments | 0  Link to this post

Mar30

Dynamic Data Source Controls for Your Data Form Web Parts

In this very, very, *very* old (but still interesting) ASP.net article on MSDN Magazine, I found the following clever code snippit that uses a temporary file to create a user control dynamically from a string:
 
TemplateColumn bc = new TemplateColumn();
String tmp = Session.SessionID + ".ascx";
StreamWriter sw;
sw = new StreamWriter(Server.MapPath(tmp));
sw.Write(strLayoutCode);
sw.Close();
bc.ItemTemplate = Page.LoadTemplate(tmp);
grid.Columns.Add(bc);
File.Delete(Server.MapPath(tmp));

 
This is indeed pretty neat, but it turns out it's not necessary. You can do the same with the following:
 
Page.TemplateControl.ParseControl(strLayoutCode);
 
I discovered this interesting fact after realizing that SharePoint's DataFormWebPart is doing some intriguingly useful (but obfuscated) stuff with DataSourceControls and the SQL database. Basically, in the SharePoint Designer, whatever controls you put inside the DataSources tag - using the design pane, I would assume - get serialized into a BLOB in the WebParts table of your WSS Content database. At run time, they get loaded from the database on the first call to get the DataSources collection, which typically happens during CreateChildControls.
 
I tried forcing a load by explicitly setting DataSourcesString within code, but it blew up because the parser did not understand the tag prefixes in the code that I inserted. It was then that I realized that SharePoint is leveraging ParseControl(string), and after digging in the database, I was able to see that SPD must be programmatically determining what namespaces to register when it saves the data to SQL by way of the DataSourcesString property.
 
This is useful to me because for a long time I have been thinking that SharePoint, and in a greater sense ASP.net needed a way to allow data source controls to be defined more flexibly and in a centralized location. Sure, you can do it programmatically. But, the control parser gives you a fairly efficient way of doing it using a repeatable and flexible process, and you won't be limited to keeping the controls on the filesystem.
 
If you want to leverage this functionality without giving up the other benefits of the Data Form, check out SPARK project over at CodePlex. It includes Flex Data Form, a version of the DFWP that inherits all the same features as the original, but allows you to set the DataSources string and some other properties from within the Web UI. (It also has some other nifty features as well.)
 
Update: Looks like I am not the only one thinking along these lines. Too bad his comments are closed, because his ideas are good ones and he deserves the Whuffie. :-)
 
More Data Form goodness, especially a decent explaination of the OOTB method for overcoming the list GUID issues that plague migration of the DFWP.
Published: Mar-30-09 | 0  Comment | 0  Link to this post

Feb23

SharePoint Code Published on CodePlex

After thinking this over for a while, and hiring a new employee, I've decided to truly make my SharePoint library both a more accessible and more collaborative effort by publishing it using CodePlex.
 
 
The SPARK project includes many of the examples published previously in articles from this blog, so those who have commented that you received 401/403 errors here should go there and download the source code. Just search through the files in the Behemoth.SharePoint project it to find the classes mentioned in the blog.
 
Why Behemoth? Well, because at least right now, the code is a big unstoppable monster. There's tons of code that needs to be ported over, (re)tested, and documented. Like any mythic beast, it is powerful and also a little scary. Plus the name fits with the theme of my company Colossus Consulting.
 
I'll be doing more additions and documentation in the coming weeks, so I hope if some of you find the code informative or useful that you'll leave me some love in the comments and reviews. (I also accept beer from those in the DC area.)
Published: Feb-23-09 | 0  Comment | 0  Link to this post

Dec16

Did You Know: Include XSL In SharePoint Search Results

Maybe some of you already knew this, but I sure didn't until I tried it. Thanks to Ian Morrish for his post about the XSLT Standard Library for helping me put the peices together.
 
So my little journey into customizing SharePoint Search Results started a few days ago. I won't go into a ton of detail because there are plenty of good blogs out there on how to do this, and anything I have to say on the subject will likely go into Memex. It suffices to say that the method of using XSL to transform the rendering of search results is about a thousand times better than the crazy web part development that I had to do in 2003 in order to accomplish the same results.
 
But my headaches began when I decided to try and make use of XSLT 2.0 function capability to leverage some nifty string manipulations like those found here. I needed to use something like "substring-before-last" to trim the file extension off the end of document titles (really, URLs) that were coming from a search protocol handler for content outside of SharePoint.
 
Try as I might, I could not get it to work, and the error information for XSL validation is hidden from you, so my attempts to determine the cause were only causing me more grief. I could switch the stylesheet to version 2.0, add the necessary namespaces, and even declare functions with xsl:function. But whenever I would try to call the function (even with constants) I would get that monolithic web part error "Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator."
 
So, in the end here is what I was able to do. I downloaded the entirety of the XSLTSL zip file and uploaded its contents into a document library on my SharePoint site using Explorer View. (I safely ignored the error I got from one file that wouldn't upload.) This makes all the XSL files web accessible, but I suppose there could be other approaches that would work just as well, like uploading these files into a subfolder under "/_layouts/".
 
Now, I tried making the xsl:import tag work, but there was no love there. However, xsl:include seems to work just fine. I wonder why the SharePoint folks don't make more use of includes in their own XSL. Though I guess it wasn't strictly necessary, it would've made for cleaner code and easier customization of things like Data Form Web Parts and such.
 
So, once you have you library chock full of stylesheets, modify the top level tag of your Search Results XSL to look like this:
 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://xsltsl.org/xsl/documentation/1.0" xmlns:str="http://xsltsl.org/string" extension-element-prefixes="doc str">
Then, add includes just below the last "xsl:param" tag, like so:
 
<!-- Import libraries for common use -->
<xsl:include href="/XSL%20Library/xsltsl-1.2.1/string.xsl" />
You can add as many includes as you like. Generally I try to only include the ones I will actually be using. The URL for the include statement should point to the path of the desired XSL document on your site. I was able to get both absolute URLs (with protocol and DNS names) and root relative URLs (leading slash) to work, but I didn't try file system based URLs to see if they would work.
 
Now, you can use the templates defined in the included file just like they were declared directly in the web part itself.
 
In my example, I put this tag between the document title and the description.
 
   </xsl:choose>
   <!-- code added - TC -->
   <div style="font-weight:bold; color: red">
   <xsl:call-template name="str:to-upper">
    <xsl:with-param name="text" select="title" />
   </xsl:call-template>
   </div>
   <!-- end code added - TC -->
   <div class="srch-Description">
 

The results look like this:
 
Custom Search Results Screen Capture
 
If I were to dig through all these function, I bet I could think up some fancy stuff to try. Better yet, why not make an XSL template library specific to SharePoint and share it with the community?
Published: Dec-16-08 | 0  Comment | 0  Link to this post

Dec08

Extreme Custom Navigation in SharePoint

I was digging through old tasks in Outlook that were never marked completed, and I came across an e-mail from a coworker. I won't paste it here, but the gist was a question regarding using images in the SharePoint top level navigation. I put this question into the same category as others like how to customize the navigation HTML or control word breaking so long items appear on two lines. This sender had wanted to know how to include custom icons within each navigation node.

The question referred to an early SharePoint article (link) that mentioned interactive buttons. Sadly, this is not the same thing as navigation. Even so, the images are obtained through the use of backgrounds in CSS, and this is not exactly the same as having an icon alongside the text in the form of an IMG tag.

So, what are the best options for creating very customized navigations in SharePoint? I spent a little time in Memex, describing a little bit about what's good and bad about different methods. Later, I want to return to this post and really delve into some kind of out of the ordinary things you could do using custom navigation - hopefully with some demos and code samples.

Published: Dec-08-08 | 0  Comment | 0  Link to this post

Dec04

My Four Day Trip through Wonderland: Fixing Windows Live Authentication in the CKS EBE

At first, I was thinking about naming this blog post "Can It Really Be That Stupid?" After a few seconds, I realized the answer is "Yes.", got over it, and moved on. For one thing, I would have to decide which thing was *that* stupid, and that's just asking too much.

So, there are a number of people out there using SharePoint with WLA. It seems like a cool concept. Just use the WLA membership and role providers the way you would any provider for forms based authentication, and "Voilla!" your friends or business partners on Live Messenger can log in to your site using their Live ID , whereupon you can give them special access.

Last year, the Community Kit for SharePoint released a WLA membership provider designed to be used with the Enhanced Blog Edition. If you're curious - and very brave - you can get the source code from CodePlex here. The solution comes with a readme, which leaves out a couple of minor steps, but Rolf Eleveld has a nice walkthrough with screenshots on his blog.

Oh, if only it had actually been that easy!

Access Denied Errors on Login for LiveAuth-Handler.aspx

After following all the instructions to set up WLA, I tried to log in on the public facing site by clicking the Sign In link, but I kept receiving the "401 UNAUTHORIZED" error. A quick check of the IIS logs reveleaded this as "HTTP 401.5: Denied by custom ISAPI/CGI Web application", which means that the access issue is occurring within SharePoint itself.

There are so many causes for this kind problem, but I remembered solving such an issue about a year and a half ago. Here are some of the things you can try if you are having 401 problems.

  1. Disable Loopback Checking
    This security "feature" is enabled by default with the latest service packs, but it was not really meant to be used in SOA environments like SharePoint. Basically, whenever SharePoint attempts to hit its own web services on the local machine, IIS will block the attempt and cause SharePoint to throw an Access Denied error. The issue described in the Microsoft KB Article is not exactly what I was seeing, but it contains instructions on how to perform the registry hack. In the past I have seen this problem cause unusual symptoms within SharePoint that you normally wouldn't see in a vanilla ASP.net application, so I wouldn't rule it out.
  2. General Tips for 401 Errors in IIS
    You can also try some of the things suggested by this Microsoft KB Article. It has useful links to some diagnostic tools including the AACD 1.0 and FileMon. At the very least, following this approach should help to uncover any typical problems that would interfere with any SharePoint install, with or without CKS.
  3. SharePoint File Permissions
    Make sure you have all the correct file rights set up for the anonymous (IUSR_MACHINE) and application pool accounts. You can use FileMon to test for this (see above). This will include rights to the ASPX files in the LAYOUTS folder, including special anonymous access permissions that are needed for Login.aspx, Authenticate.aspx, and in our case LiveAuth-Handler.aspx. Generally, if you have IUSR_MACHINE in the WSS_WPG group, and the application pool account in the WSS_ADMIN_WPG group, then that ought to do it.
  4. Is Your Provider Working?
    Make sure your authentication provider is set up correctly. In this case, I would double check the setup as per the instructions described with the WLA provider above.

    One way to test this is to add the same provider settings to your internal (Windows Authentication) and Central Administration sites. With these added, you should be able to go into your windows authentication based site and add Live Authenticated Users as a group with rights within SharePoint – even if you can't successfully get the Live ID login process to work.


    Figure: Testing correct setup of WLA Users and Groups from the intranet (Windows Auth) site

    In my case, I added the membership, roleManager, and appSettings nodes to the web.config file located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG, because I wanted these providers to be accessible to every web application on my development machine. However, I will probably go "by the book" in production.

    Also, note that I have commented out the identity node (namely, impersonation="true") in the public facing (FBA) web.config file, as this is normal practice for FBA sites, but wasn't mentioned in the WLA documentation.

Unfortunately, none of these things I tried actually solved my problem. Every page I would try to visit would redirect me to Authenticate.aspx, and then that would subsequently 302 redirect me to LiveAuth-Handler.aspx?action=login, which would give me the same 401 error.

As a quick aside, let's look at how the login process actually works, because I was thinking about it a lot at the time. We start on the main page of the blog, and if you have Anonymous Access configured in SharePoint and also correctly configured in IIS, then you'll see the default.aspx page with its Sign In link displayed correctly.

As you can see, this link takes you to Authenticate.aspx, which is SharePoint's default page for requiring a login, and the one that is responsible for redirecting you to LiveAuth-Handler.aspx as described in web.config, whereupon, we get the dreaded 401.5 error. Authenticate.aspx seemed to be working as designed, but I was at a loss to explain the error.

My Eureka Moment: Running Out Into the Street without My 401

After a full day of beating my head against the machine I was getting a bit crazy, so I decided to take a break. I put the computer away and went to an Orioles game with a pal of mine. Perhaps my best tip of the day, do not underestimate the value of taking a break. Your brain will keep working on the problem in the background while you recharge your batteries. In fact, I had a great time. Not only was this the first time in over a decade that they won while I was at the stadium (what awful luck!), but they delivered a spectacular grand slam followed by a three run homer, literally crushing the Cleveland Indians.

So, the following morning I was thinking about what is different in the WLA that I have never seen in any FBA based solution before. If I could find the variables, and eliminate them, I might solve the problem or at least discover the cause. One thing that struck me as just-too-stupid-to-think-about was the URL that specified in the loginUrl attribute of the forms tag in the authentication section of web.config.

"What if," I thought, "however unlikely it may be, there is something in the .NET authentication provider that refuses to recognize the login page simply because it can't handle the query string at the end?" Well, it sure seemed like the kind of shortcoming that would typically sneak into code, but I had never heard of such an issue. Still, there are lots of patches both for .NET framework and SharePoint, so maybe I'm on a patched version that has this rare problem.

So, I tried a little experiment. I took out the query string, like so.

Click the Sign In link again, and…

"Wow! There's no way it can be that simple." I put the query string back into the web.config, then tried to log in again, just to be sure.

In fact, if you take the query string out of web.config, but you add it manually on the address line of your browser, it will work as expected. The result redirects you to the Windows Live web site without any 401. Note that I've made some improvements to my source code. If you manually type the login URL on the address bar using the code as downloaded from CodePlex, you are much more likely to see some kind of NullReferenceException instead of a successful 302. But my point is that it will actually run your code.

The Final Verdict: Ye Not Guilty

So, then, this answers how to fix the problem, but doesn't identify the cause. Is this an issue with the .NET framework or maybe SharePoint itself? Well, that might be possible, but I thought it was unlikely given that these products have probably gotten some pretty thorough testing, especially compared to CKS and the WLA provider. But, I was on a mission. I wanted to make this work, and I had a clear path to explore, so there was no time to ponder this in depth.

What should've also crossed my mind at the time - but didn't - is that this issue might have been caused by code running in CKS itself. I ran into some other issues in the following days, but after everything blew over, I did some experiments to try and prove that CKS EBE itself was not at the heart of this particular problem. (Turns out I proved myself wrong.) To test this, I tried changing the settings for Secure System Pages in the CKS EBE Settings (a.k.a. Blog Settings).

There were two takeaways from this that finally explain this issue in black and white.

Lesson #1
The first is that just because you change your Blog Settings on the internal (Windows Authentication) site, does not mean they will automatically change on the public facing (FBA) site. While trying to make changes to the setting above, I learned that you need to make changes to Blog Settings manually to both sites. This is actually pretty cool, because it means you can select different themes for each and change some settings as appropriate. Also, it makes sense, since these blog settings are stored as a section in web.config for each site. But it is also a pain, especially if you have already configured FBA on the public site and you can't actually login to make settings changes.

Lesson #2
Second, I learned that everything I did from here on out is – at least partly – unnecessary. To work around this issue you simply need to turn Secure System Pages off. This will eliminate the problem with the login page having a query string. Of course, I happen to like this setting and want to use it on my public facing site, so I'll be working with this code to make it work properly with WLA.

Ever Deeper Down the Rabbit Hole

Now that I've revealed "whodunit" in this little mystery, let me jump back. Instead of finding the exact cause right away, I would spend the next two days trying to make the login page work correctly without the query string. I went through a lot of code changes to liveatuh-handler.cs in the attempt, and I learned a lot. Because this is not the end of the story, I plan to talk about these things just a bit before I'm done, but nobody will blame you if you skip all that and just get the code. [TODO: publish and link to code please]

So my first approach was to try and rewrite liveauth-handler.aspx so that it could just tell that you were going from Authenticate.aspx and redirect you to the Windows Live site automatically without being told via the query string. To some extent, this worked, but it took some messing around the find the right commands, and the HTTP_REFERER was not always what I expected it to be.

Here's a screen shot from my early code:

You can see at this point that I had already done some work to eliminate "Object Reference Not Set" exceptions. That's pretty typical of code written in a rush. You get it working to the extent that you need it to. Since you have other stuff to do, there isn't time to imagine every way in which it might go outside that corral, you move on. Unfortunately, it results in code that breaks easily, which it did for me many times.

You can see in these shots of the debugger as I was digging around for the HTTP_REFERER variable within the page Request object.

Its value would typically be something ending in "default.aspx" or "authenticate.aspx" whenever I was clicking through from the Sign In link. It would be easy enough to tell that the referrer was on the same server using a string comparison or RegEx, but fortunately the .NET framework has provided a couple of handy properties in the HttpRequest class that help to isolate the host name. These are Url and UrlReferer as seen below.

Interestingly, page redirects from the WLA site would have no referrer at all. I would've preferred something like "https://login.live.com/ppsecure/post.srf?appid=000000004400143A&alg=wsignin1.0..." Alas, no, they are just blank. This makes them indistinguishable from URLs entered on the address bar, and that made testing a nuisance.

Despite this, I was able eventually to muddle through. There were a number of setbacks, like this one:

This issue, or some other error, will happen when you have Secure System Pages turned on. (The exception message is my code and not part of CKS EBE or WLA, because I thought it would be helpful for other developers.) I did some experimentation to prove that when Secure System Pages is turned off, the new users will be automatically redirected to liveinfo.aspx as they should be. Also, the issue does not affect users who have already entered an email address in their Blog User Profile, because those users are typically redirected to a generic (unsecured) page such as default.aspx instead.

What's going on here is that Windows Live returns with a valid session ticket as an HTTP form post, but since the user does not yet exist in SharePoint or have any rights other than those granted to Live Authenticated Users, they get redirected from liveinfo.aspx to the liveauth-handler.aspx login page, probably by way of authenticate.aspx. (In the original source code from CodePlex, this would've forced their session to be logged out.) The redirect causes the contents of Request.Form to be lost, which is the means by which WindowsLiveLogin.ProcessLogin() method receives data from the Windows Live website. Even though you'd think that such an internal referral should have some kind of value in Request.UrlReferrer, its value is in fact null. The code, as I had written it at this point, failed because this condition is a contradiction. On the one hand it thinks it is supposed to process some kind of result from Windows Live, but that information has been dropped.

In a nutshell this means that any user who hasn't provided an email address is going to get some kind of error after they log in, and it is very likely that such an error will cause the authentication process to break down before all the cookies have been properly set. Looking at all this strange behavior, I have decided that the entire flow for the page needs to be streamlined and bulletproofed. (Though as of December I still haven't gotten around to it.) It's too convoluted and unreliable when conditions fall outside the norm. In the long run, the issue can be corrected entirely by fixing the code for BlogHttpModule.cs in the CKS.EBE solution.

But, let's talk a minute about the process by which I came to discover that this is what was going on, because it did not come easily.

To have results come back from the Windows Live site, and not have any form attached to them, was very confusing to me. I wanted to try and prove that the form was in fact coming back across the wire, and then being lost someplace else. To this end, I downloaded a very useful tool called EffeTech HTTP Sniffer which I have used on many passed projects to gain insight into what SharePoint is doing behind the scenes. It is my opinion that an HTTP Sniffer of some kind should be included on every SharePoint developer's installation checklist.

I was unable to get any meaningful data from the HTTP Sniffer though, which returned only a generic HTTP request and a GIF for the passport logo. Upon post-back from the Windlows Live server there was not showing up in the trace. So, I tried their EtherDetect product to see if I could figure it out. Here is an example of what came back.

Digging into these, I was able to determine that my server was opening a random port that connected to their server on port 443. Several tests concluded the port was random, and so I was unable to add it to the list of ports in the HTTP sniffer, and everything I saw in the Ethernet sniffer was of course encrypted. Unfortunately, this is a failing of the EffeTech HTTP Sniffer. The MSN Sniffer was totally useless for WLA. But, at least I was able to determine that there was some kind of data coming back.

Eventually, I was able to blunder into the solution of manually adding an email address to my entry in ProfileList, and that got me around the problem with redirection to viewinfo.aspx. This is not a good final solution, but I was able to move on to the next problem.

Okay, so now I could see that I had a form and I was able to step through code to the point where I could see that SetAuthCookie was executing. But, as far as I could tell, there was no cookie and no authentication within SharePoint going on at this point.

By this time, I may have been chasing foo-fighters. I had been a while in the weeds, and the default theme for CKS EBE provides no visual indication that you are signed into SharePoint as any particular user - something I have since changed in my own blog site as you can see at the top of this page. For this reason, I recommend that you create your own theme that makes use of the wssuc:Welcome control to tell you who is logged in. It could very well be that for some time I was actually successful at authenticating and did not know it, because Live Authenticated Users was not assigned any special rights. Note that even if you add this group to the Contributors, it will not automatically be able to create Blog Posts.

Another thing I tried was to remove the domain and path properties from my forms tag in web.config, but I have since put them back so I know they are not to blame in this case. I also tried changing the name of the form from "livelogin" to "LiveID", but I have also changed this back without any effect. For the time being if there were authentication issues around cookies, I have been unable to reproduce the problem.

Ultimate Solution: Fix Secure System Pages

Although I did eventually end up reverting to the use of a query string for the liveauth-handler.aspx page, I wanted to clean up the code somewhat anyway. I also implemented a fix for the BlogHttpHandler.cs that resolves many of the issues described above, and could probably be improved upon even more. Given time I would like to make the list of allowed system pages configurable from an XML file in the Feature (or maybe even web.config itself).

You can download the code here. I only provide the files in question, and I'll submit these issues to CodePlex as soon as I get the chance, but I wanted to make them available here for those experiencing similar problems. Enjoy! [TODO: publish code and provide link]

Published: Dec-04-08 | 0  Comment | 0  Link to this post

Dec01

What Tool Should You Use to Deploy SharePoint Projects?

At this point, I have tried them all. I hand rolled my solutions; used early versions of WSPBuilder; struggled with the interface for VSeWSS 1.0, 1.1 CTP, and 1.1 final; and even tried a few offbeat solutions.
 
Until this summer, every method had serious problems that made packaging and deployment problematic. Revisiting my posts, I see that I never mentioned this before, but I owe props to my colleague Ted Calhoon who turned my on to the WSPBuilder Extensions. I switched over, and I never looked back.
 
 
They are a bit counterintuitive, and the commands to flush out the folder structure are well buried, but once you get the hang of them, they are the best around - at least until someone comes up with something better.
 
In future, I'll do a walkthrough.
Published: Dec-01-08 | 0  Comment | 0  Link to this post

Nov20

CKS EBE Construction Finished?

After some false starts and delays, I have finally gotten CKS EBE working on this prodiuction server. True, it is not the prettiest or most customized theme in the universe, but it is working.
 
Next, I have to try and get the Windows Live Authentication configured correctly so y'all can use your MSN/.NET Messenger IDs to sign into the site. I also have further some customizations to the banner and theme planned. Oh! And, a complete reworking of the post catagories.
Published: Nov-20-08 | 0  Comment | 0  Link to this post

 Next >>
`