<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>allbacktomine</title>
    <link>http://www.allbacktomine.com/blog/</link>
    <description>newtelligence powered</description>
    <language>en-us</language>
    <copyright>Sherwin Rice</copyright>
    <lastBuildDate>Wed, 25 Mar 2009 14:06:08 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>sherwin@allbacktomine.com</managingEditor>
    <webMaster>sherwin@allbacktomine.com</webMaster>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=be90e863-1df8-4e2e-9352-fc9b65aa93fa</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,be90e863-1df8-4e2e-9352-fc9b65aa93fa.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,be90e863-1df8-4e2e-9352-fc9b65aa93fa.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=be90e863-1df8-4e2e-9352-fc9b65aa93fa</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">SharePoint designer is not my favourite
piece of software by a looooong way, it has a habit of corrupting page layouts, and
of misreporting the check-in state of files (among other 'quirks'). I finally got
hacked off enough with the check-in bug to try and work out what was going on:<br /><br />
I have a stylesheet in my style library (which we'll call foo.css) that is showing
as being checked out to my colleague. Looking at the style library through the SharePoint
UI shows that foo.cs is not checked out to anyone, implying that SharePoint designer
is caching the state of foo.css somewhere. No amount of restarting SharePoint Designer
or refeshing the site makes any difference to the state of foo.css<br /><br />
At this point i decided to use <a href="http://www.google.co.uk/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Fsysinternals%2Fbb896653.aspx&amp;ei=RDbKSczRKMXKjAfo5rTOAw&amp;usg=AFQjCNHOrBM9nMXCxTSHvpqueGSDpTTkHw&amp;sig2=yvBwtmULPwuqdpy_swHh0A">process
explorer</a> to see what files SharePoint Designer was reading from, in the hope of
spotting something that looked like it was related to caching. Process explorer by
default produces a vast amount of data, so I set some filters to restrict it to the
SharePoint Designer process (SPDESIGN.EXE) and the ReadFile operation:<br /><br /><br /><p></p><img src="http://www.allbacktomine.com/blog/content/binary/filter.jpg" border="0" /><br /><br /><br />
I started event capturing in Process Explorer, started SD, and opened up my SharePoint
site, which produced several hundred events; one of which looked like a winner:<br /><br /><br /><br /><br /><img src="http://www.allbacktomine.com/blog/content/binary/SPDESIGN.jpg" border="0" /><br /><br />
I've blurred out the filename, but as you can probably guess, it's the url of my SharePoint
site, with dots replaced by underscores. The content of this file is (almost) human
readable, certainly enough so that i could see a reference to foo.css within it, so
i tried deleting it and reloading my site in SD: This fixed the problem, foo.css was
correctly shown as being checked in.<br /><br /><i>Note, if you delete this file whilst your site is open in SD, the file will be
recreated when you close SD! Therefore, make sure SD is closed prior to deleting the
file.</i><br /><br /><br /><img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=be90e863-1df8-4e2e-9352-fc9b65aa93fa" /></body>
      <title>WORKAROUND: SharePoint Designer shows file as checked out when it is not.</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,be90e863-1df8-4e2e-9352-fc9b65aa93fa.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2009/03/25/WORKAROUNDSharePointDesignerShowsFileAsCheckedOutWhenItIsNot.aspx</link>
      <pubDate>Wed, 25 Mar 2009 14:06:08 GMT</pubDate>
      <description>SharePoint designer is not my favourite piece of software by a looooong way, it has a habit of corrupting page layouts, and of misreporting the check-in state of files (among other 'quirks'). I finally got hacked off enough with the check-in bug to try and work out what was going on:&lt;br&gt;
&lt;br&gt;
I have a stylesheet in my style library (which we'll call foo.css) that is showing
as being checked out to my colleague. Looking at the style library through the SharePoint
UI shows that foo.cs is not checked out to anyone, implying that SharePoint designer
is caching the state of foo.css somewhere. No amount of restarting SharePoint Designer
or refeshing the site makes any difference to the state of foo.css&lt;br&gt;
&lt;br&gt;
At this point i decided to use &lt;a href="http://www.google.co.uk/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Fsysinternals%2Fbb896653.aspx&amp;amp;ei=RDbKSczRKMXKjAfo5rTOAw&amp;amp;usg=AFQjCNHOrBM9nMXCxTSHvpqueGSDpTTkHw&amp;amp;sig2=yvBwtmULPwuqdpy_swHh0A"&gt;process
explorer&lt;/a&gt; to see what files SharePoint Designer was reading from, in the hope of
spotting something that looked like it was related to caching. Process explorer by
default produces a vast amount of data, so I set some filters to restrict it to the
SharePoint Designer process (SPDESIGN.EXE) and the ReadFile operation:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.allbacktomine.com/blog/content/binary/filter.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I started event capturing in Process Explorer, started SD, and opened up my SharePoint
site, which produced several hundred events; one of which looked like a winner:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.allbacktomine.com/blog/content/binary/SPDESIGN.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
I've blurred out the filename, but as you can probably guess, it's the url of my SharePoint
site, with dots replaced by underscores. The content of this file is (almost) human
readable, certainly enough so that i could see a reference to foo.css within it, so
i tried deleting it and reloading my site in SD: This fixed the problem, foo.css was
correctly shown as being checked in.&lt;br&gt;
&lt;br&gt;
&lt;i&gt;Note, if you delete this file whilst your site is open in SD, the file will be
recreated when you close SD! Therefore, make sure SD is closed prior to deleting the
file.&lt;/i&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=be90e863-1df8-4e2e-9352-fc9b65aa93fa" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,be90e863-1df8-4e2e-9352-fc9b65aa93fa.aspx</comments>
      <category>SharePoint</category>
      <category>workaround</category>
    </item>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=673f0fe5-7099-47e1-9c4f-09f892305ad0</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,673f0fe5-7099-47e1-9c4f-09f892305ad0.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,673f0fe5-7099-47e1-9c4f-09f892305ad0.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=673f0fe5-7099-47e1-9c4f-09f892305ad0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Hopefully this may save someone some time....<br /><br />
A few days ago I changed the Url of one of my MOSS site collections by:<br /><ul><li>
Going to Central Admin-&gt; Operations -&gt;Alternate Access Mappings and updating
my default zone url to my new url</li><li>
Using the IIS management console to change the host header of my site collection's
web application to my new url</li></ul>
This all worked fine for a few days, until one of my users tried to edit a page's
'page settings &amp; schedule' and received this error:<br /><br /><font><font color="red">System.ArgumentException. Value does not fall within the expected
range.     
<br />
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl,
Int32 METADATAFLAGS, Guid&amp; pgListId, Int32&amp; plItemId, Int32&amp; plType, Object&amp;
pvarFileOrFolder)      
<br />
at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32
METADATAFLAGS, Guid&amp; pgListId, Int32&amp; plItemId, Int32&amp; plType, Object&amp;
pvarFileOrFolder)      
<br />
at Microsoft.SharePoint.SPWeb.GetMetadataForUrl(String relUrl, Int32 mondoProcHint,
Guid&amp; listId, Int32&amp; itemId, Int32&amp; typeOfObject, Object&amp; fileOrFolder)      
<br />
at Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl)      
<br />
at Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb
web)</font></font><br /><br />
When i searched the SharePoint log files for this error, i found it along with a reference
to my <i>old</i> site url, which made me think my approach for renaming a site collection
url hadn't been 100% successful...<br /><br />
Some googling produced <a href="http://blogs.technet.com/stefan_gossner/archive/2008/03/12/common-error-situation-with-when-using-backup-restore-to-transfer-a-database-to-a-new-farm-on-moss-2007.aspx">this
post by Stefan Goßner</a> ( whose blog has helped me out with many a strange error,
dating back to his MCMS days). Although his post relates to backing up &amp; restoring
to a different site, the end result would appear to be the same:<br /><br />
&lt;snip&gt;<br />
The reason for this problem is that backup/restore does not adjust the references
from the publishing page objects in the Pages library to their Page Layouts.
These URLs are sometimes stored as absolute URLs including the server name. And this
server name is the server name of the old server farm which cannot be resolved on
the new farm.<br />
&lt;/snip&gt;<br /><br />
Running Stefan's <a href="http://code.msdn.microsoft.com/FixPageLayout">FixPagelayout</a> utility
fixed the problem.<br /><br /><br /><br /><h1><a id="ctl00___ctl00___bth___BlogTitle" class="headermaintitle" href="http://blogs.technet.com/stefan_gossner/default.aspx"><br /></a></h1><p></p><img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=673f0fe5-7099-47e1-9c4f-09f892305ad0" /></body>
      <title>FIX: Changing your MOSS site Url causes 'Value does not fall within the expected range' errors</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,673f0fe5-7099-47e1-9c4f-09f892305ad0.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2009/02/11/FIXChangingYourMOSSSiteUrlCausesValueDoesNotFallWithinTheExpectedRangeErrors.aspx</link>
      <pubDate>Wed, 11 Feb 2009 15:43:46 GMT</pubDate>
      <description>Hopefully this may save someone some time....&lt;br&gt;
&lt;br&gt;
A few days ago I changed the Url of one of my MOSS site collections by:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Going to Central Admin-&amp;gt; Operations -&amp;gt;Alternate Access Mappings and updating
my default zone url to my new url&lt;/li&gt;
&lt;li&gt;
Using the IIS management console to change the host header of my site collection's
web application to my new url&lt;/li&gt;
&lt;/ul&gt;
This all worked fine for a few days, until one of my users tried to edit a page's
'page settings &amp;amp; schedule' and received this error:&lt;br&gt;
&lt;br&gt;
&lt;font&gt;&lt;font color="red"&gt;System.ArgumentException. Value does not fall within the expected
range.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl,
Int32 METADATAFLAGS, Guid&amp;amp; pgListId, Int32&amp;amp; plItemId, Int32&amp;amp; plType, Object&amp;amp;
pvarFileOrFolder)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32
METADATAFLAGS, Guid&amp;amp; pgListId, Int32&amp;amp; plItemId, Int32&amp;amp; plType, Object&amp;amp;
pvarFileOrFolder)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
at Microsoft.SharePoint.SPWeb.GetMetadataForUrl(String relUrl, Int32 mondoProcHint,
Guid&amp;amp; listId, Int32&amp;amp; itemId, Int32&amp;amp; typeOfObject, Object&amp;amp; fileOrFolder)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
at Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
at Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb
web)&lt;/font&gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
When i searched the SharePoint log files for this error, i found it along with a reference
to my &lt;i&gt;old&lt;/i&gt; site url, which made me think my approach for renaming a site collection
url hadn't been 100% successful...&lt;br&gt;
&lt;br&gt;
Some googling produced &lt;a href="http://blogs.technet.com/stefan_gossner/archive/2008/03/12/common-error-situation-with-when-using-backup-restore-to-transfer-a-database-to-a-new-farm-on-moss-2007.aspx"&gt;this
post by Stefan Goßner&lt;/a&gt; ( whose blog has helped me out with many a strange error,
dating back to his MCMS days). Although his post relates to backing up &amp;amp; restoring
to a different site, the end result would appear to be the same:&lt;br&gt;
&lt;br&gt;
&amp;lt;snip&amp;gt;&lt;br&gt;
The reason for this problem is that backup/restore does not adjust the references
from the publishing page objects&amp;nbsp;in the Pages library to their Page Layouts.
These URLs are sometimes stored as absolute URLs including the server name. And this
server name is the server name of the old server farm which cannot be resolved on
the new farm.&lt;br&gt;
&amp;lt;/snip&amp;gt;&lt;br&gt;
&lt;br&gt;
Running Stefan's &lt;a href="http://code.msdn.microsoft.com/FixPageLayout"&gt;FixPagelayout&lt;/a&gt; utility
fixed the problem.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h1&gt;&lt;a id="ctl00___ctl00___bth___BlogTitle" class="headermaintitle" href="http://blogs.technet.com/stefan_gossner/default.aspx"&gt;
&lt;br&gt;
&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=673f0fe5-7099-47e1-9c4f-09f892305ad0" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,673f0fe5-7099-47e1-9c4f-09f892305ad0.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=98ebbf6e-3daf-477a-a8a7-907ae2703284</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,98ebbf6e-3daf-477a-a8a7-907ae2703284.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,98ebbf6e-3daf-477a-a8a7-907ae2703284.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=98ebbf6e-3daf-477a-a8a7-907ae2703284</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I love 'bugs' like this, as they result
in a very satisfying 'aha' moment.<br /><br />
I've been working on an internet facing <a href="http://www.microsoft.com/Sharepoint/default.mspx">SharePoint
MOSS </a>site that uses forms authentication and a <a href="http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx">custom
membership provider</a> to authenticate users against the client's back office system.
The back office system already has a web front end, and some of this functionality
we needed to expose through the MOSS site: rewriting this functionality wasn't an
option, so we chose to embed the existing back office web pages within iframes hosted
in MOSS pages.<br /><br />
Given this setup, we had to ensure that when a user was logged into the MOSS site,
the user would not also be prompted to login to the back office system whenever they
hit a back office page hosted in an iframe. 
<br /><br />
The back office system uses a simple authentication scheme; if you've logged in successfully
it places a  cookie on your machine which is used on all subsequent requests
to verify that you are authenticated. As the back office web site is on a different
domain to our MOSS site we cant just simply set the cookie ourselves within some custom
MOSS code, we have to somehow get the back office system to set the cookie. To do
this we are using a similar technique to a <a href="http://en.wikipedia.org/wiki/Web_bug">web
bug</a>: when a user successfully logs into MOSS, we write a hidden &lt;img&gt; tag
pointing to a file on the back office web server. The url contains the information
needed for the back office to believe the request is from the authenticated user,
and so the response from the back office web server will set the cookies we need.
Our &lt;img&gt; tag looks like this:<br /><br /><font face="Courier New">&lt;img src="http://foo-backoffice/MembersArea/custom/setcookies.asp?UserValidated=xxxxxxxx&amp;UserCheckSum=f0701xxxxxxxxxxxxxb359c87&amp;redirectUrl=http://foo-backoffice/MembersArea/custom/active.gif"
style="display:none;" /&gt;</font><br /><br />
And the response from the backoffice server looks like this (captured using <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>);<br /><br /><img src="/img/cookie1.jpg" /><br /><br /><br />
So the user now has an authentication cookie for the back office domain. Note that
the back office application has specified a path for the cookie of /MembersArea.<br /><br />
Now, if the user browses a MOSS page that hosts an iframe pointing at a back office
page, the authentication cookie is sent to the back office and the user is <i>not </i>prompted
to login to the  back office. An example iframe tag from our 'update your profile'
MOSS page:<br /><br /><font face="Courier New">&lt;iframe width="715px" height="1400px" scrolling="no" frameborder="no"
src="http://foo-backoffice/membersarea/updates/layout1.asp"&gt;&lt;/iframe&gt;</font><br /><br />
The problem i encountered was this: <b><i>the user was still being prompted to login
to the back office, despite the web bug successfully setting the authentication cookie!</i></b><br /><br />
Using Fiddler I could see that the authentication cookie was <i>not </i>being passed
to <font face="Courier New">http://foo-backoffice/membersarea/updates/layout1.asp</font>,
and after some head scratching &amp; some experimenting i realised why: 
<br /><br /><ul><li>
The authentication cookie had it's path set to /MembersArea  <i>(note the case)</i></li><li>
The back office web page i was trying to load in the iframe was <font face="Courier New">http://foo-backoffice/membersarea/updates/layout1.asp</font></li></ul>
So, when you request a url and your browser checks to see if you have a cookie for
that url, the browser is doing a case sensitive comparison between the cookie path
and request url. This is certainly true in IE7 - i haven't tested this in other browsers.<br /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=98ebbf6e-3daf-477a-a8a7-907ae2703284" /></body>
      <title>Browser cookies: the path is case sensitive!</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,98ebbf6e-3daf-477a-a8a7-907ae2703284.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2009/02/04/BrowserCookiesThePathIsCaseSensitive.aspx</link>
      <pubDate>Wed, 04 Feb 2009 11:51:17 GMT</pubDate>
      <description>I love 'bugs' like this, as they result in a very satisfying 'aha' moment.&lt;br&gt;
&lt;br&gt;
I've been working on an internet facing &lt;a href="http://www.microsoft.com/Sharepoint/default.mspx"&gt;SharePoint
MOSS &lt;/a&gt;site that uses forms authentication and a &lt;a href="http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx"&gt;custom
membership provider&lt;/a&gt; to authenticate users against the client's back office system.
The back office system already has a web front end, and some of this functionality
we needed to expose through the MOSS site: rewriting this functionality wasn't an
option, so we chose to embed the existing back office web pages within iframes hosted
in MOSS pages.&lt;br&gt;
&lt;br&gt;
Given this setup, we had to ensure that when a user was logged into the MOSS site,
the user would not also be prompted to login to the back office system whenever they
hit a back office page hosted in an iframe. 
&lt;br&gt;
&lt;br&gt;
The back office system uses a simple authentication scheme; if you've logged in successfully
it places a&amp;nbsp; cookie on your machine which is used on all subsequent requests
to verify that you are authenticated. As the back office web site is on a different
domain to our MOSS site we cant just simply set the cookie ourselves within some custom
MOSS code, we have to somehow get the back office system to set the cookie. To do
this we are using a similar technique to a &lt;a href="http://en.wikipedia.org/wiki/Web_bug"&gt;web
bug&lt;/a&gt;: when a user successfully logs into MOSS, we write a hidden &amp;lt;img&amp;gt; tag
pointing to a file on the back office web server. The url contains the information
needed for the back office to believe the request is from the authenticated user,
and so the response from the back office web server will set the cookies we need.
Our &amp;lt;img&amp;gt; tag looks like this:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;lt;img src="http://foo-backoffice/MembersArea/custom/setcookies.asp?UserValidated=xxxxxxxx&amp;amp;UserCheckSum=f0701xxxxxxxxxxxxxb359c87&amp;amp;redirectUrl=http://foo-backoffice/MembersArea/custom/active.gif"
style="display:none;" /&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
And the response from the backoffice server looks like this (captured using &lt;a href="http://www.fiddlertool.com/fiddler/"&gt;Fiddler&lt;/a&gt;);&lt;br&gt;
&lt;br&gt;
&lt;img src="/img/cookie1.jpg"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
So the user now has an authentication cookie for the back office domain. Note that
the back office application has specified a path for the cookie of /MembersArea.&lt;br&gt;
&lt;br&gt;
Now, if the user browses a MOSS page that hosts an iframe pointing at a back office
page, the authentication cookie is sent to the back office and the user is &lt;i&gt;not &lt;/i&gt;prompted
to login to the&amp;nbsp; back office. An example iframe tag from our 'update your profile'
MOSS page:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;lt;iframe width="715px" height="1400px" scrolling="no" frameborder="no"
src="http://foo-backoffice/membersarea/updates/layout1.asp"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
The problem i encountered was this: &lt;b&gt;&lt;i&gt;the user was still being prompted to login
to the back office, despite the web bug successfully setting the authentication cookie!&lt;/i&gt;&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Using Fiddler I could see that the authentication cookie was &lt;i&gt;not &lt;/i&gt;being passed
to &lt;font face="Courier New"&gt;http://foo-backoffice/membersarea/updates/layout1.asp&lt;/font&gt;,
and after some head scratching &amp;amp; some experimenting i realised why: 
&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
The authentication cookie had it's path set to /MembersArea&amp;nbsp; &lt;i&gt;(note the case)&lt;/i&gt;
&lt;/li&gt;
&lt;li&gt;
The back office web page i was trying to load in the iframe was &lt;font face="Courier New"&gt;http://foo-backoffice/membersarea/updates/layout1.asp&lt;/font&gt;
&lt;/li&gt;
&lt;/ul&gt;
So, when you request a url and your browser checks to see if you have a cookie for
that url, the browser is doing a case sensitive comparison between the cookie path
and request url. This is certainly true in IE7 - i haven't tested this in other browsers.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=98ebbf6e-3daf-477a-a8a7-907ae2703284" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,98ebbf6e-3daf-477a-a8a7-907ae2703284.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=ce11e989-5529-4cd4-b962-fe5100541cbd</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,ce11e989-5529-4cd4-b962-fe5100541cbd.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,ce11e989-5529-4cd4-b962-fe5100541cbd.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ce11e989-5529-4cd4-b962-fe5100541cbd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was building a breadcrumb trail for a site I was working on, and using the SiteMapPath
control to render the breadcrumb. I wanted to hide the root node from the breadcrumb,
but as the SiteMapControl gets its data directly from a SiteMapProvider rather than
via a SiteMapDataSource, we cant use the SiteMapDataSource.ShowStartingNode property
to hide the root node. I used this workaround:<br /></p>
        <p>
Handle the SiteMapPath's ItemCreated event, where you can hide the root node:
</p>
        <pre class="c-sharp" name="code">    //override the Page's OnInit
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        Breadcrumb.ItemCreated += new SiteMapNodeItemEventHandler(Breadcrumb_ItemCreated);
    }

    void Breadcrumb_ItemCreated(object sender, SiteMapNodeItemEventArgs e)
    {

        //hide the root node, and it's following path separator
        if (e.Item.ItemIndex == 0 
            | (e.Item.ItemIndex ==1 &amp;&amp; e.Item.ItemType ==SiteMapNodeItemType.PathSeparator))
        {
            e.Item.Visible = false;
        }
    }
</pre>
        <img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=ce11e989-5529-4cd4-b962-fe5100541cbd" />
      </body>
      <title>Hiding the root node from the SiteMapPath control</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,ce11e989-5529-4cd4-b962-fe5100541cbd.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2008/11/18/HidingTheRootNodeFromTheSiteMapPathControl.aspx</link>
      <pubDate>Tue, 18 Nov 2008 12:56:57 GMT</pubDate>
      <description>&lt;p&gt;
I was building a breadcrumb trail for a site I was working on, and using the SiteMapPath
control to render the breadcrumb. I wanted to hide the root node from the breadcrumb,
but as the SiteMapControl gets its data directly from a SiteMapProvider rather than
via a SiteMapDataSource, we cant use the SiteMapDataSource.ShowStartingNode property
to hide the root node. I used this workaround:&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Handle the SiteMapPath's ItemCreated event, where you can hide the root node:
&lt;/p&gt;
&lt;pre class="c-sharp" name="code"&gt;    //override the Page's OnInit
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        Breadcrumb.ItemCreated += new SiteMapNodeItemEventHandler(Breadcrumb_ItemCreated);
    }

    void Breadcrumb_ItemCreated(object sender, SiteMapNodeItemEventArgs e)
    {

        //hide the root node, and it's following path separator
        if (e.Item.ItemIndex == 0 
            | (e.Item.ItemIndex ==1 &amp;amp;&amp;amp; e.Item.ItemType ==SiteMapNodeItemType.PathSeparator))
        {
            e.Item.Visible = false;
        }
    }
&lt;/pre&gt;
&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=ce11e989-5529-4cd4-b962-fe5100541cbd" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,ce11e989-5529-4cd4-b962-fe5100541cbd.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=6ea104ae-2886-4f2d-884f-7e4a093cdb4a</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,6ea104ae-2886-4f2d-884f-7e4a093cdb4a.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,6ea104ae-2886-4f2d-884f-7e4a093cdb4a.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=6ea104ae-2886-4f2d-884f-7e4a093cdb4a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">This has bitten me a few times, so may
save someone else a few minutes head scratching:<br /><br />
If you change a SharePoint site's authentication provider, you might find that when
you subseqently come to use the 'People Picker' dialog in various admin screens, and
enter what you <i>know</i> to be a valid username, the 'People Picker' will not find
that name. I have had this happen to me several times, and it's always been caused
by one of these 2 reasons:<br /><br /><ul><li>
Make sure the 'Membership Provider Name' and 'Role Manager Name' match the values
you have specified in your site's web.config AND Central Administration's web.config. 
<br /></li></ul><br /><img src="http://www.allbacktomine.com/img/WSS-auth.jpg" /><br /><br /><ul><li>
If your providers access a backing store, make sure its is accessible. For example,
if you are using the AspNetSqlMembershipProvider and your connection string is set
to use integrated security, the identity of your application pool(s) will need access
to the ASPNET SQL database.<br /></li></ul><p></p><img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=6ea104ae-2886-4f2d-884f-7e4a093cdb4a" /></body>
      <title>SharePoint People Picker and Changing Authentication providers</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,6ea104ae-2886-4f2d-884f-7e4a093cdb4a.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2008/07/30/SharePointPeoplePickerAndChangingAuthenticationProviders.aspx</link>
      <pubDate>Wed, 30 Jul 2008 10:13:10 GMT</pubDate>
      <description>This has bitten me a few times, so may save someone else a few minutes head scratching:&lt;br&gt;
&lt;br&gt;
If you change a SharePoint site's authentication provider, you might find that when
you subseqently come to use the 'People Picker' dialog in various admin screens, and
enter what you &lt;i&gt;know&lt;/i&gt; to be a valid username, the 'People Picker' will not find
that name. I have had this happen to me several times, and it's always been caused
by one of these 2 reasons:&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Make sure the 'Membership Provider Name' and 'Role Manager Name' match the values
you have specified in your site's web.config AND Central Administration's web.config. 
&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
&lt;img src="http://www.allbacktomine.com/img/WSS-auth.jpg"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
If your providers access a backing store, make sure its is accessible. For example,
if you are using the AspNetSqlMembershipProvider and your connection string is set
to use integrated security, the identity of your application pool(s) will need access
to the ASPNET SQL database.&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=6ea104ae-2886-4f2d-884f-7e4a093cdb4a" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,6ea104ae-2886-4f2d-884f-7e4a093cdb4a.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I was trying to use a DataPager and ListView
control in a custom MOSS page layout, but these 2 controls were causing parser errors:<br /><br /><span><h1>Server Error in '/' Application. 
<hr color="silver" size="1" width="100%" /></h1><h2><i>Parser Error</i></h2></span><font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><b>Description: </b>An
error occurred during the parsing of a resource required to service this request.
Please review the following specific parse error details and modify your source file
appropriately. 
<br /><br /><b>Parser Error Message: </b>Unknown server tag 'asp:DataPager'.<br /><br /><b>Source Error:</b><br /><br /><table bgcolor="#ffffcc" width="100%"><tbody><tr><td><code></code><pre>Line 25: 	&lt;div class="pageContent"&gt;<br />
Line 26: 
<br /><font color="red">Line 27: &lt;asp:DataPager ID="Pager" runat="server" PagedControlID="lstvNews"
PageSize="10" QueryStringField="page" class="paging"&gt;<br /></font>Line 28: &lt;Fields&gt;<br />
Line 29: &lt;asp:NextPreviousPagerField ButtonType="Image" ShowFirstPageButton="True"
FirstPageImageUrl="img/arrow-left.gif" ShowNextPageButton="False" ShowPreviousPageButton="False"
/&gt;</pre></td></tr></tbody></table><br /><b>Source File: </b>/_catalogs/masterpage/News.aspx<b>    Line: </b>27 
<br /><br /><hr color="silver" size="1" width="100%" /><b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.1433;
ASP.NET Version:2.0.50727.1433 
<br /><br /><br />
These 2 controls live in a separate assembly to your regular ASP.NET controls, called
System.Web.Extensions.dll, which by default SharePoint knows nothing about as SharePoint
predates the release of this assembly.<br /><br />
To get SharePoint to recognise these controls you need to ammend your SharePoint site's
web.config, usually found in C:\Inetpub\wwwroot\wss\VirtualDirectories\[your site's
port number]\web.config<br /><br />
First, add the assembly to the list of safe controls:<br /><br />
&lt;SafeControl Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" Namespace="System.Web.UI.WebControls" TypeName="*"
Safe="True" AllowRemoteDesigner="True" /&gt;<br /><br /><br />
 Then, locate the &lt;pages&gt; node under &lt;system.web&gt; and add the following
to &lt;pages&gt;:<br /><br />
&lt;controls&gt;<br />
        &lt;add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;<br />
        &lt;add tagPrefix="asp" namespace="System.Web.UI.WebControls"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;<br />
&lt;/controls&gt;<br /><br /><br />
Once you've made these ammendments the parser error should go away<br /></font><p></p><img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84" /></body>
      <title>Unknown server tag 'asp:DataPager' error thrown by a SharePoint page layout</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2008/07/29/UnknownServerTagAspDataPagerErrorThrownByASharePointPageLayout.aspx</link>
      <pubDate>Tue, 29 Jul 2008 11:06:14 GMT</pubDate>
      <description>I was trying to use a DataPager and ListView control in a custom MOSS page layout, but these 2 controls were causing parser errors:&lt;br&gt;
&lt;br&gt;
&lt;span&gt; 
&lt;h1&gt;Server Error in '/' Application. 
&lt;hr color="silver" size="1" width="100%"&gt;
&lt;/h1&gt;
&lt;h2&gt;&lt;i&gt;Parser Error&lt;/i&gt; 
&lt;/h2&gt;
&lt;/span&gt;&lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;&lt;b&gt;Description: &lt;/b&gt;An
error occurred during the parsing of a resource required to service this request.
Please review the following specific parse error details and modify your source file
appropriately. 
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Parser Error Message: &lt;/b&gt;Unknown server tag 'asp:DataPager'.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Source Error:&lt;/b&gt; 
&lt;br&gt;
&lt;br&gt;
&lt;table bgcolor="#ffffcc" width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;&lt;/code&gt;&lt;pre&gt;Line 25: 	&amp;lt;div class="pageContent"&amp;gt;&lt;br&gt;
Line 26: 
&lt;br&gt;
&lt;font color="red"&gt;Line 27: &amp;lt;asp:DataPager ID="Pager" runat="server" PagedControlID="lstvNews"
PageSize="10" QueryStringField="page" class="paging"&amp;gt;&lt;br&gt;
&lt;/font&gt;Line 28: &amp;lt;Fields&amp;gt;&lt;br&gt;
Line 29: &amp;lt;asp:NextPreviousPagerField ButtonType="Image" ShowFirstPageButton="True"
FirstPageImageUrl="img/arrow-left.gif" ShowNextPageButton="False" ShowPreviousPageButton="False"
/&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
&lt;b&gt;Source File: &lt;/b&gt;/_catalogs/masterpage/News.aspx&lt;b&gt; &amp;nbsp;&amp;nbsp; Line: &lt;/b&gt;27 
&lt;br&gt;
&lt;br&gt;
&lt;hr color="silver" size="1" width="100%"&gt;
&lt;b&gt;Version Information:&lt;/b&gt;&amp;nbsp;Microsoft .NET Framework Version:2.0.50727.1433;
ASP.NET Version:2.0.50727.1433 
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
These 2 controls live in a separate assembly to your regular ASP.NET controls, called
System.Web.Extensions.dll, which by default SharePoint knows nothing about as SharePoint
predates the release of this assembly.&lt;br&gt;
&lt;br&gt;
To get SharePoint to recognise these controls you need to ammend your SharePoint site's
web.config, usually found in C:\Inetpub\wwwroot\wss\VirtualDirectories\[your site's
port number]\web.config&lt;br&gt;
&lt;br&gt;
First, add the assembly to the list of safe controls:&lt;br&gt;
&lt;br&gt;
&amp;lt;SafeControl Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" Namespace="System.Web.UI.WebControls" TypeName="*"
Safe="True" AllowRemoteDesigner="True" /&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;Then, locate the &amp;lt;pages&amp;gt; node under &amp;lt;system.web&amp;gt; and add the following
to &amp;lt;pages&amp;gt;:&lt;br&gt;
&lt;br&gt;
&amp;lt;controls&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add tagPrefix="asp" namespace="System.Web.UI.WebControls"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;br&gt;
&amp;lt;/controls&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Once you've made these ammendments the parser error should go away&lt;br&gt;
&lt;/font&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,dd3f44dc-6a13-48a2-bb66-6bd00cdc4a84.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=86a2e78b-1915-48e5-aef6-9bed5a8db1ca</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,86a2e78b-1915-48e5-aef6-9bed5a8db1ca.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,86a2e78b-1915-48e5-aef6-9bed5a8db1ca.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=86a2e78b-1915-48e5-aef6-9bed5a8db1ca</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Ever connected to a server using Remote
Desktop only to find you've been connected to a new/different session to the one you
were last using? 
<br /><br />
I can't believe i've only just discovered this(!), but this works a treat:<br /><br /><br /><ul><li>
Connect to your server using Remote Desktop</li><li>
Open Terminal Services Manager</li><li>
Locate the session you wish to connect to, and either double-click, or choose 'connect'
from the context menu</li><li>
Your session should magically switch to the one you selected<br /></li></ul><br /><img src="http://www.allbacktomine.com/img/terminal-services-manager.jpg" /><br /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=86a2e78b-1915-48e5-aef6-9bed5a8db1ca" /></body>
      <title>How To Switch Between Remote Desktop Sessions on Win2k3</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,86a2e78b-1915-48e5-aef6-9bed5a8db1ca.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2008/07/18/HowToSwitchBetweenRemoteDesktopSessionsOnWin2k3.aspx</link>
      <pubDate>Fri, 18 Jul 2008 08:15:44 GMT</pubDate>
      <description>Ever connected to a server using Remote Desktop only to find you've been connected to a new/different session to the one you were last using? &lt;br&gt;
&lt;br&gt;
I can't believe i've only just discovered this(!), but this works a treat:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Connect to your server using Remote Desktop&lt;/li&gt;
&lt;li&gt;
Open Terminal Services Manager&lt;/li&gt;
&lt;li&gt;
Locate the session you wish to connect to, and either double-click, or choose 'connect'
from the context menu&lt;/li&gt;
&lt;li&gt;
Your session should magically switch to the one you selected&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
&lt;img src="http://www.allbacktomine.com/img/terminal-services-manager.jpg"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=86a2e78b-1915-48e5-aef6-9bed5a8db1ca" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,86a2e78b-1915-48e5-aef6-9bed5a8db1ca.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.allbacktomine.com/blog/Trackback.aspx?guid=fecd99bd-69fa-448b-ad85-acd6094451f7</trackback:ping>
      <pingback:server>http://www.allbacktomine.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.allbacktomine.com/blog/PermaLink,guid,fecd99bd-69fa-448b-ad85-acd6094451f7.aspx</pingback:target>
      <dc:creator>Sherwin</dc:creator>
      <wfw:comment>http://www.allbacktomine.com/blog/CommentView,guid,fecd99bd-69fa-448b-ad85-acd6094451f7.aspx</wfw:comment>
      <wfw:commentRss>http://www.allbacktomine.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=fecd99bd-69fa-448b-ad85-acd6094451f7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I've been working on a video player app
over the last few weeks using Silverlight 2.0 Beta 1, so <a href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx">when
beta 2 was released</a> last week I was intrigued to see whether my app would still
work; and the short answer is that it did not :-(<br /><br />
The easy bits to fix were the compile time errors, and i'd been expecting a few of
them having read the<a href="http://msdn.microsoft.com/en-us/library/cc645049%28VS.95%29.aspx"> beta
2 breaking changes doc</a> in advance whilst waiting for beta 2 to download. The problem
that stumped me was the video playback at runtime: I was hearing the audio but <i>no</i> video
was displaying.<br /><br />
The method i'm using for video playback is to use a hidden MediaElement to play the
video, and then use a <a href="http://msdn.microsoft.com/en-us/library/bb404773.aspx">VideoBrush </a>to
'paint' the video onto a Rectangle; You 'attach' the VideoBrush to a MediaElement
by setting the VideoBrush.SourceName=MediaElement.Name. 
<br /><br />
Both my MediaElement and VideoBrush are created dynamically in the codebehind, and
because because we need the MediaElement to have a Name we have to use <a href="http://msdn.microsoft.com/en-us/library/cc190359%28VS.95%29.aspx">XamlReader.Load()</a> to
create the MediaElement, because the Name property is read only and can not be set
from within your code: <br /><br /><pre class="c-sharp" name="code">MediaElement me1= XamlReader.Load(@"&lt;MediaElement 
<br />
                                xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
<br />
                                Name='me1'
Opacity='0' /&gt;") as MediaElement;<br />
LayoutRoot.Children.Add(mediaElement);<br />
VideoBrush vb = new VideoBrush();<br />
vb.SourceName = me1.Name;<br />
MyRectangle.Fill=vb; </pre><p>
That code works fine in beta 1, but in beta 2 MyRectangle remains blank!
</p><p>
The clue to fixing this is included in the <a href="http://msdn.microsoft.com/en-us/library/cc645049%28VS.95%29.aspx">breaking
changes doc</a>:
</p><blockquote><p><span value="XamlReader.Load(string)" sdata="langKeyword"><span class="keyword"><a>"XamlReader.Load(string)</a></span></span><a> has
been changed to always create an implicit namescope."</a></p></blockquote>So what appears to be happening under beta 2 is that the VideoBrush is
searching for a MediaElement named 'me1' in the default Xaml namescope, but it can
not find it as me1 was created in its own implicit namescope.<br /><br /><br />
So how do we fix this? The method I have used is to create the VisualBrush within
the same namescope as the MediaElement, and i've done this by including the VisualBrush
in the MediaElement's Resources:<br /><br /><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><pre class="c-sharp" name="code">MediaElement me1 = XamlReader.Load(@"&lt;MediaElement<br />
                                 xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'<br />
                                 Name='me1'
AutoPlay='False' Opacity='0.0' IsHitTestVisible='False' &gt;<br />
                                    &lt;MediaElement.Resources&gt;<br />
                                       &lt;VideoBrush
Name='vb1' SourceName='me1'/&gt;<br />
                                    &lt;/MediaElement.Resources&gt;<br />
                                    &lt;/MediaElement&gt;")
as MediaElement;<br />
VideoBrush vb = me1.FindName("vb1") as VideoBrush;<br />
MyRectangle.Fill=vb; </pre><br /><font face="Verdana" size="2">After doing this, MyRectangle once again displays the
video :-)</font><br /><p><br /></p><p><br /></p><p></p></span></p><p></p></span><img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=fecd99bd-69fa-448b-ad85-acd6094451f7" /></body>
      <title>Silverlight Beta 2 broke my VideoBrush</title>
      <guid isPermaLink="false">http://www.allbacktomine.com/blog/PermaLink,guid,fecd99bd-69fa-448b-ad85-acd6094451f7.aspx</guid>
      <link>http://www.allbacktomine.com/blog/2008/06/10/SilverlightBeta2BrokeMyVideoBrush.aspx</link>
      <pubDate>Tue, 10 Jun 2008 12:37:12 GMT</pubDate>
      <description>I've been working on a video player app over the last few weeks using Silverlight 2.0 Beta 1, so &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx"&gt;when
beta 2 was released&lt;/a&gt; last week I was intrigued to see whether my app would still
work; and the short answer is that it did not :-(&lt;br&gt;
&lt;br&gt;
The easy bits to fix were the compile time errors, and i'd been expecting a few of
them having read the&lt;a href="http://msdn.microsoft.com/en-us/library/cc645049%28VS.95%29.aspx"&gt; beta
2 breaking changes doc&lt;/a&gt; in advance whilst waiting for beta 2 to download. The problem
that stumped me was the video playback at runtime: I was hearing the audio but &lt;i&gt;no&lt;/i&gt; video
was displaying.&lt;br&gt;
&lt;br&gt;
The method i'm using for video playback is to use a hidden MediaElement to play the
video, and then use a &lt;a href="http://msdn.microsoft.com/en-us/library/bb404773.aspx"&gt;VideoBrush &lt;/a&gt;to
'paint' the video onto a Rectangle; You 'attach' the VideoBrush to a MediaElement
by setting the VideoBrush.SourceName=MediaElement.Name. 
&lt;br&gt;
&lt;br&gt;
Both my MediaElement and VideoBrush are created dynamically in the codebehind, and
because because we need the MediaElement to have a Name we have to use &lt;a href="http://msdn.microsoft.com/en-us/library/cc190359%28VS.95%29.aspx"&gt;XamlReader.Load()&lt;/a&gt; to
create the MediaElement, because the Name property is read only and can not be set
from within your code:&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&lt;pre class=c-sharp name="code"&gt;MediaElement me1= XamlReader.Load(@"&amp;lt;MediaElement 
&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name='me1'
Opacity='0' /&amp;gt;") as MediaElement;&lt;br&gt;
LayoutRoot.Children.Add(mediaElement);&lt;br&gt;
VideoBrush vb = new VideoBrush();&lt;br&gt;
vb.SourceName = me1.Name;&lt;br&gt;
MyRectangle.Fill=vb; &lt;/pre&gt;
&lt;p&gt;
That code works fine in beta 1, but in beta 2 MyRectangle remains blank!
&lt;/p&gt;
&lt;p&gt;
The clue to fixing this is included in the &lt;a href="http://msdn.microsoft.com/en-us/library/cc645049%28VS.95%29.aspx"&gt;breaking
changes doc&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;span value="XamlReader.Load(string)" sdata="langKeyword"&gt;&lt;span class=keyword&gt;&lt;a&gt;"XamlReader.Load(string)&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;a&gt; has
been changed to always create an implicit namescope."&lt;/a&gt;
&lt;/p&gt;
&lt;/blockquote&gt;So what appears to be happening under beta 2 is that the VideoBrush is
searching for a MediaElement named 'me1' in the default Xaml namescope, but it can
not find it as me1 was created in its own implicit namescope.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
So how do we fix this? The method I have used is to create the VisualBrush within
the same namescope as the MediaElement, and i've done this by including the VisualBrush
in the MediaElement's Resources:&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;pre class=c-sharp name="code"&gt;MediaElement me1 = XamlReader.Load(@"&amp;lt;MediaElement&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name='me1'
AutoPlay='False' Opacity='0.0' IsHitTestVisible='False' &amp;gt;&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;MediaElement.Resources&amp;gt;&lt;br&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;&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;lt;VideoBrush
Name='vb1' SourceName='me1'/&amp;gt;&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/MediaElement.Resources&amp;gt;&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/MediaElement&amp;gt;")
as MediaElement;&lt;br&gt;
VideoBrush vb = me1.FindName("vb1") as VideoBrush;&lt;br&gt;
MyRectangle.Fill=vb; &lt;/pre&gt;
&lt;br&gt;
&lt;font face=Verdana size=2&gt;After doing this, MyRectangle once again displays the video
:-)&lt;/font&gt;
&lt;br&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;img width="0" height="0" src="http://www.allbacktomine.com/blog/aggbug.ashx?id=fecd99bd-69fa-448b-ad85-acd6094451f7" /&gt;</description>
      <comments>http://www.allbacktomine.com/blog/CommentView,guid,fecd99bd-69fa-448b-ad85-acd6094451f7.aspx</comments>
      <category>Silverlight </category>
      <category>VideoBrush</category>
    </item>
  </channel>
</rss>