| John's profileJohn Liu .NET: Time for ...PhotosBlogLists | Help |
|
John Liu .NET: Time for Fun in .NEThas moved to http://johnliu.net Leaving Windows Live Spaces for SquareSpaceFinally packed up my stuff and getting ready to leave Windows Live Spaces. After four years of blogging here, I’ve decided to resurrect my own domain and continue there. NEW HOME HERE: http://johnliu.net Figure: clean new website http://johnliu.net
Why the sudden change? Didn’t you try this before and gave up? (2007 running my own web server at home… not fun). Well… truth of the matter is – Windows Live is great for a free solution, but the tweaks that I wanted to do, and can’t were continually giving me grief.
I ended up wanting to pay for a service where I can have more flexibility, without the maintenance headaches of running my own servers, and hopefully not too expensive. I found such a solution at SquareSpace – so I’m moving. A web dev joke… if I could do a 301 Permanent Redirect here, I would. But you know this is Windows Live Spaces…
First blog entry at the new home will be about the great Migration of data from Windows Live Spaces to SquareSpace. If you want to learn about how to get your data out of Windows Live Spaces, you will have to follow me there.
Signing out - jliu SharePoint: Groove assimilated by the Borg (aka SharePoint)Prepare to be assimilated by the Borg. ...Groove is getting a new name as of the coming release of Office 2010. Please welcome SharePoint Workspace 2010!
The name makeover is in concert with the direction the product is going. SharePoint Workspace will provide easy access to SharePoint content (or content from any server that implements the publicly documented protocols) in an effort to provide a seamless online/offline experience.
Regardless, Groove has always been a pretty niche product – people that have used it liked it. Other people didn’t understand what it did. Now that it gets this re-branding I think there will be a lot more interest in this product and the offline capabilities. Good move on MS. My colleague Marlon always complains to me that he can’t get his docs from SharePoint when we put our SharePoint on maintenance... I’m sure he’ll be happier now.
jliu SharePoint - service pack 2 thoughtsSharePoint service pack 2 came out a couple of days ago, for some reason I was really excited about it and even woke up checking twitter regarding any news… It was surprisingly empty. Anyway, over the last couple of days I’ve had a good whirl and here’s some thoughts – both mine, and heard over the grapevine.
Authentication — Improvements to forms-based authentication, authentication for Web applications, and the Business Data Catalog. MSDN is saying that when Forms authentication is used SharePoint “should” do a better job at letting client (Browser) remember the password. I’m hoping this means I don’t need to re-enter my password a billion times.
Database performance and integrity — Improved database performance and integrity by automatically rebuilding database indexes with a timer job. Self checks are good
Interoperability — Improved support for standards-based document formats and compatibility with a broader range of browsers level 1 and level 2 browser support. IE8 enters level 1 browser support – the rich text editing should get fixed FireFox2/3 enters level 2 browser support
Read-only content databases — Improved user experience by automatically configuring site collections as read-only when the content database is configured as read-only. Again a good thing
Stsadm command-line tool — In addition to operations for pre-upgrade scanning and variations analysis and repair, several operations are improved and new operations added to better support farm administration. stsadm –o backup will now issue a stsadm –o setsitelock prior to the backup, unless otherwise stated. This means that sharepoint administrators no longer need to do this in two steps. stsadm –o deletesite now supports a force argument that allows orphaned site collections or orphaned sites to be deleted. Only time I’ve seen an orphan site is when we had a bad import that failed halfway.
Pre-upgrade scanning and reporting — An Stsadm operation that enables you to scan an existing farm and its servers to verify that they can be upgraded SharePoint Products and Technologies "14". stsadm -o preupgradecheck is only to check against future versions of SharePoint 2010.
Variations analysis and repair — An Stsadm operation that enables farm administrators to better manage and perform necessary operations against variations. There’s a quite bit of work for variations. This isn’t an area where I’ve had a lot of experience.
Merge Content DB bug fixed Yay
Breaking Changes: Areas web service removed There’s some impact to Nintex Workflows – there’s an interim fix that they’ve released, as well as a patch coming out within a week. IIS7 WCF .SVC 404This is a tip for myself: For the weird reasons I could not understand – if your IIS7/Vista doesn’t have a handler for .svc all of a sudden – you can re-register them using the following registration. I’m still not sure why this suddenly stopped working :-(
"C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y SharePoint - On the verge of launching a new release of a SharePoint siteOn the verge of launching a new release of a public SharePoint website and I came across this list (from shanselman’s twitter actually). 15 Essential Checks Before Launching Your Website Here’s how we fared:
So we scored 10/15. Ticked off most of the easy ones. Have quite a few really tough ones left. Wish us luck! SharePoint – thoughts on MSDN “Configuring and Deploying Anonymous Publishing Sites for SharePoint Server 2007”Andrew Connell’s white paper on Configuring and Deploying Anonymous Publishing Sites for SharePoint Server 2007 just went up on MSDN. The following are my thoughts in detail. For the most part – I agree with the views presented in the white paper, and I believe the white paper covered at a glance many of the crucial aspects of anonymous publishing. Some of these points I wanted to further elaborate and explain some of my own experiences and/or approaches that I’ve found to work better.
Limiting the Page Payload Fiddler is great. FireFox’s FireBug also serves a similar purpose. You want to try to reduce the number of files that are sent across. Reducing CSS, core.js, core.css will go a long way to reduce the page payload. I’ve found HttpModule to be far better at stripping core.js, core.css and much of the unused form hidden fields from the output. Need a lot of testing though. In addition – check out YSlow FireFox add-in. Which discusses issues such as E-Tags not being set properly in IIS – you might as well turn it off and let browsers determine file base on modified date / size. Managing the Name ActiveX Control This is related to my earlier blog SharePoint – Name ActiveX Control error. I discussed the circumstances on why this ActiveX control is appearing, what does it do, and why does it only give you grief when running in the Internet Zone on IE. While the Mossman Way works – I prefer using a HttpModule. Anyway – I thought if Person Name Smart Tag and Presence Settings is switched off via Central Administration this would have gone away (mentioned later in the white paper). UPDATE - tested this doesn't work - while the setting is off it still asks for the Active-X Taking Advantage of Custom CAS Policies for Custom Code Use CAS policies so you can keep to WSS_Minimal. Many of our assemblies are deployed in the GAC which runs in full trust. The reason we put them in the GAC is more a decision related to solution package deployment, and not from a security point of view. Configuring a SharePoint Site Collection or Site Blocking Users from Seeing All Pages in a SharePoint Publishing Site ViewFormPagesLockdown is absolutely necessary. I’m so glad it’s mentioned in this white paper. Enabling and Configuring Caching page output caching and object caching are mentioned – both are very useful. Page Output caching for the anonymous profile is necessary to achieve high performance from a public site. Remember to switch on the comment so you can catch caching issues from your staging and production servers. blob caching is not mentioned – I’m not sure the reasons, but I’ve found it to be useful but I have seen the blob cache rendering and cropping only half of the CSS file that I have. Is that a SharePoint bug? Hard to say. I found some blog articles that asked the same questions – blob caching is one of those supposedly-low-risk-high-gain performance configurations that you can do, but I ended up with only use blob caching with sufficient testing. Configuring a SharePoint Web Application Disabling User Presence Information Just echoing this – I think this should stop the ActiveX presence “name.dll” appearing on IE when you stop this. UPDATE - tested this doesn't work - while the setting is off it still asks for the Active-X Disabling the Blog API Disabling Incoming E-Mail Separating Content Between Authoring and Production Environments I noticed I stopped commenting much towards the end of the article. It was good to see publishing content deployment being discussed at the end - great article. SharePoint – IE8 standards mode causes trouble in SharePointRunning SharePoint on IE8 – JavaScript errors when using the rich text editor. ‘null’ is null or not an object – in form.js
The debugger shows that the SharePoint javascript code was trying to call: document.getElementById("ctl00_PlaceHolderMain_EditModePanel3_ctl04_ctl00_RichHtmlField_displayContent_LTR") The id of that element is actually: ctl00_PlaceHolderMain_EditModePanel3_ctl04_ctl00_RichHtmlField_displayContent_ltr In IE7’s incorrect JavaScript behavior – it finds the element and returns it. In IE8’s correct JavaScript behavior – it doesn’t find the element and returns null. -> Error! --- IE8 will attempt to use IE7 compatibility mode when accessing intranet sites. It will use IE8 standards mode when accessing public internet sites. This means that when accessing your SharePoint site via the extranet URL – http://sharepoint.company.com/ you will get this error, but accessing it internally – http://sharepoint/ will be OK. ---- Ways to fix this (easy to hard):
So you want to be a SharePoint architectSomeone asked what is a SharePoint architect: Here’re my thoughts collected and reposted (and most likely incomplete):
Skills such as list, documents, workflow, permissions... are a bit too basic and are requirement for a SharePoint DEVELOPER. I'd argue that perhaps site (and site structure) is an area that would fall under the architect's plate. There are more areas that a SharePoint architect can help with:
I think it takes at least a couple of years to be a SharePoint architect (your mileage may differ). Your .NET architects need to want-to-be a SharePoint architect, otherwise I agree with other's summaries before me - find someone who already is a SharePoint architect. Bad Microsoft (System.Web) code got owned by StackOverflowHere’s an amazing question asked by Diadistis on StackOverflow. http://stackoverflow.com/questions/653730/gc-collect-in-a-loop Won’t go into details you got to read it if you are interested. SharePoint – Name ActiveX Control error.
This error pops up on SharePoint MOSS publishing websites that are in the Internet security zone for IE browsers. This is because the core.js file wants to use ActiveX control “name.dll”, this ActiveX control is responsible for the presence information for SharePoint. In the Internet security zone, IE pops this question to the user to ask them whether they want the ActiveX to run. In development For developers, if you have accidentally clicked “Yes Allow it to run”, then you won’t see this error and it can hinder your debugging of your public SharePoint site. This is a RegEdit fix to get rid of this key to see name.dlll ActiveX warning in IE again. HKCU\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{E18FEC31-2EA1-49A2-A7A6-902DC0D1FF05} I have been told that some server machines doesn’t seem to have this key. UPDATE try: HKCU\Software\Microsoft\Windows\CurrentVersion\Ext\Stats\{E18FEC31-2EA1-49A2-A7A6-902DC0D1FF05} Fix
Javascript - jQuery + ASP.NET – post-AJAX eventsFrom jQuery, we get $(document).ready which is wonderful.
One of the common problems that people have is regarding how to re-run the scripts after the UpdatePanel ajax update. Here is one javascript-based solution – I consider these less intrusive than the code-behind solution with ClientScript. Disclaimer – I learn this from previous projects I’ve worked on with personal experimentation – but I have not since read much documentation.
Original: $(document).ready( function() { $("a.link").css("border", "1px solid red"); }) The improved: function setupLinkBorder( parentElement ) { $("a.link", parentElement).css("border", "1px solid red"); } $(document).ready( function() { if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager && Sys.WebForms.PageRequestManager.getInstance()) {
re: Dell NewsletterAfter reading yet another Dell monthly newsletter, I decided to reply to it. I figure it’s rant-worthy. Hi Mr Dell, When I purchased my laptop, I was after a couple of spare 9-cell battery for longer battery life, and I was told it was out of stock, which is fair enough – these things go out of stock from time to time. I specifically left instructions that when they are in stock, I would like to be notified. Because I _really_ want them. It has since been 6 months, and I find it hard to believe that they are still out of stock. I think it’s good customer relationship management to: 1. give me an update on what's going on 2. you may need to fix your CRM software, because I think these are simple instructions that should have been followed up on at least every 3 months - especially since the customer is already telling you he wants to spend the money 3. you should already know which laptop model that I bought from you, and that which I've specifically told the sales girl to put down a note that I want the better batteries for this laptop. jliu SharePoint - Cannot get ghost documentWe chased a fun bug in the afternoon after we deployed our new package to our staging server. Symptom: Our customized Content Query Web Parts stops rendering. Hint: This gave us the hint that our XSL was probably stuffed – but it checked out ok in SharePoint designer*. Detective Work: Digging through the SharePoint logs, we came across two lines that are incredibly suspicious: 0x17C4 Windows SharePoint Services Web Parts 89a1 Monitorable Error while executing web part: System.Xml.Xsl.XslLoadException: XSLT compile error. An error occurred at (1,482). ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at Microsoft.SharePoint.WebPartPages.WSSXmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver) at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include... 0x17C4 Windows SharePoint Services General 72ks Medium Cannot get ghost document: Features\blah\blah.xsl Story: The path to the XSL was familiar, and the problem immediately became apparent. It was the old path, we’ve since re-organized our deployment package, and that old path to the xsl file no longer works. The Fix: Drop into Style Library\ and delete all the XSL files that are ghosted. Notes: SharePoint designer must have cached the file at some point, so it was happily showing us a copy of the file while in reality due to our re-organization of the feature it wasn’t actually available anymore. Re-organizing feature package always has hidden costs… SharePoint – for those times when you really got to kill a listThis is a simple tip So the list template stuffed up a list and you can’t get to it in “site library and lists” The backdoor way to remove the list is: stsadm -o forcedeletelist -url http://server/Lists/list-name The new flood of stuff coming out of Windows Live are really niceI do have FriendFeed, but I think too little people know about FriendFeed (http://friendfeed.com/johnnliu) - but it's a very techy solution. I think Windows Live's offerings will reach more people quicker. Anyway, It's already hooked to to my blog, MSN messenger I've got 2 web activities enabled: Flickr still waiting for a few more web activities to become enabled: digg Theoretically I can just use the RSS feed from these, but I want to see what additional features I get for 'integration'. Also, when people comment on my windows live feed, I'd like to see it in MSN messenger. Anyway, waiting :) SharePoint - ContentQueryWebPart, CommonViewFields and Multi-value choicesWhen you add a choice or lookup to the CommonViewField for a ContentQueryWebPart, if you had ticked the allow multiple-values checkbox, the CQWP will return you nothing. Couple of people blogged about this: http://sridharu.blogspot.com/2008/05/content-query-webpart-customization.html Adri Verlaan [MSFT] even says: Unfortunatly the data source that the CQWP uses does not support Mutli-Valued Lookups or Multi-Choice columns.
Turns out after a bit more digging around, you _can_ use multi-value choices. To get multi-value choices to work, you need to use a different type: Instead of Choice, use MultiChoice <property name="CommonViewFields" type="string">MyDescription,PublishingHtml;MyTags,MultiChoice</property> I have not had much luck with Multi-lookup and I suspect there might be some truth in what Adri was referring to. If I consider how SharePoint might have to work with a field that contains multiple keys to a different lookup list, this problem becomes far more complex. Anyway, at least it works for choice. Have fun! jliu Lemmings 4D gameI'm pretty sure Lemmings stopped at 3D. But I think there's room to make a 4D game:
Implement in SilverLight - Utilize the harddrive - add special tools that are time based - add time-warp portals Windows Live configuration syncI had this idea that popped up when I was listening to the current .NET Rocks - The Future of Web Development Panel. I was listening to the panel lamenting about having to manually configure their development environment per machine that they use and thought, geez surely this can be solved perfectly with Windows Live. Sure enough, within minutes of this idea popping in my head, one of the guys on the panel stated this, and got overwhelming applause. That is one great idea. So, you have Windows Live Mesh right now. You can sync files, links and photos online. How hard would it be to synchronize Visual Studio settings, office settings / templates, browser settings, etc etc Taking the idea further, there is a set of tools you always use for your machine - wouldn't it be nice if you can re-use a license key (if it allows) across all your machines and share them via a Live Mesh account. Or even when you build a new machine, a Life Mesh application automatically asks you if you want to re-install all your favourite tools that you had on your previous machine - tells you if it has a newer version (say for windows 7), and / or any driver requirements. When you say "yes please", it will install these for you at a convenient time - AND copy your configuration settings so it'll behave JUST THE WAY you had it set up before! Throw in some integration with Microsoft Online Store... I can't stop drooling. If someone don't build this app soon I will! It is so great to live in a Software + Service world! These are great times! I twit now (oh and I still blog)I'm sorry I'm probably very very late to the bandwagon, but there's a few reasons for this:
Anyway, follow johnnliu (double-n) SharePoint: Error when adding a new page based on a customized (broken) page layoutException: No parameterless constructor defined for this object. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) Some interesting bits in the stack trace: ... at System.Activator.CreateInstance(Type type) ... at Microsoft.SharePoint.WebPartPages.SPWebPartSerializer.get_DefaultControl() ... at Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager.AddWebPart(WebPart webPart, String zoneId, Int32 zoneIndex) snipped remaining massive stack trace. What had happened was that we had a stuffed up Page Layout with a web part zone that contained invalid HTML. I had detected this and deleted the entire web part zone, but SharePoint must have it in the database, so each time I re-open the PageLayout it was resurrecting all the broken code. The fix wasn't at all glamorous:
We can now use the page layout to create new pages again. jliu Didn't know it could be this difficult to pull something out of the GACSo, a few days ago, one of my favorite TFS/Outlook add-on stopped working. Exception: Puzzled, I figure there's something odd with the Fusion loader. Popping into the GAC I saw this horror! I must have installed something that upgraded all the library to version 9.0. OK, no problems, let me uninstall the old version 8... Exception: A bit of reading lead me to this article. GAC Assembly Trace Reference
Hitting gacutil to see what's referencing it... c:\Program Files\Microsoft Visual Studio 9.0\VC>gacutil /lr Microsoft.TeamFoundation.WorkItemTracking.Client Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1 The Global Assembly Cache contains the following assemblies: Number of items = 2 Taking great care not to uninstall both versions, I'm being ultra cautious: c:\Program Files\Microsoft Visual Studio 9.0\VC>gacutil /l "Microsoft.TeamFoundation.WorkItemTracking.Client, Version=8.0.0.0" The Global Assembly Cache contains the following assemblies: Number of items = 1 Ok... go crazy! c:\Program Files\Microsoft Visual Studio 9.0\VC>gacutil /u "Microsoft.TeamFoundation.WorkItemTracking.Client, Version=8.0.0.0" Assembly: Microsoft.TeamFoundation.WorkItemTracking.Client, Version=8.0.0.0, Cul Not knowing the keys to run gacutil /ur, I turned and did more research: This one is from the Fusion guys http://blogs.msdn.com/alanshi/archive/2003/12/10/42690.aspx I found two of the reference keys in the registry. And exported them just to be safe. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global] Then I dropped these trace references from the registry. Head back to the GAC, uninstall the two offending Assemblies. Pop back to Outlook. Hey, my favorite addon works again. :-) Hope this helps someone out there. jliu Late blog (as in, not a live blog) Australia Power To Developers eventSo there I was, sitting in the front row of the Power to Developers event in Sydney Convention Center. A really great place by the way - it's like 5 minutes away from my home. Steve Ballmer's presentation of Windows Azure is certainly very energetic. He did the "Developers, Developers, Developers" chant - I cheered! Gianpaolo Carraro's presentation on Windows Azure services was interesting, it certainly got my hands all itchy. *Waiting for that SQL Data Services invite* Tim Sneath's very excited about Windows 7, WPF and SilverLight. I bumped into him outside the convention center and asked him about his visit to Sydney, in hindsight what I really should have asked him was which of these cool technologies should I spend all my time on? How do I choose! All the technical presentations were flaky, with the audience bursting out in laughter whenever Gianpaolo says "Oh Come On!" I also got to meet heaps of people that I worked with over the last 3 years as well as some that were in SSW before that. Shout outs: the SSW crew, SharePoint, WCF Service, .NET full/partial trustSecurity Exception: That assembly does not allow partially trusted callers Scenario:
The bigger picture looked like this:
The cause: What we understood of the problem basically was that the web.config for SharePoint http://server/web.config specified trust policies that mean anything under http://server/... was running with partial trust. This isn't necessarily a bad thing, but because the API's we were calling demanded full trust, we couldn't proceed without granting the service full trust. The fix: There are many ways to grant the service full trust, we decided to do this by placing the service assembly into the GAC on the SharePoint server.
If this option isn't available for you, check out caspol or the .NET configuration tools to elevate permission for your assembly. Thoughts: The deployment ended up to be very nice and tight:
SharePoint talks to the service via a SmartPart + jQuery.ajax Done! Windows Live Mail (Hotmail) has a nice new lookMost people probably have a Hotmail account, but like me, probably haven't visited it for quite a while. Anyway, they unleashed a new version recently that looks a lot slicker. (This is in Chrome) Very cool. I still think it misses the conversation threading view which is really fantastic in gmail, also I think tagging emails is still better than folders for organization. But it's fast and snappy and doesn't require you to use IE for the full experience. Consuming WCF WebService from jQuery AJAX (with JSON)So the guys at work are pretty sold on jQuery now. Everybody who've used it don't want to go back to vanilla JavaScript (just as I predicted). One of the things always sitting at the back of my mind is to bridge the call from jQuery.ajax to WCF WebServices. Finally we had a chance to do this, and it turns out this was pretty easy. Special mention to Alvin Shen and Ron Maman who checked this out.
Incredibly easy, the hardest part was working what the url was going to be
UPDATE technologies list:
UPDATE:
Here's a fun service that we use for testing. // Add more operations here and mark them with [OperationContract]
|
||||||||||||||||||
|
|