<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Henrik Olsson&#039;s Computer Software Notes</title>
	<atom:link href="http://holsson.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://holsson.wordpress.com</link>
	<description></description>
	<lastBuildDate>Fri, 10 Feb 2012 13:00:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='holsson.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Henrik Olsson&#039;s Computer Software Notes</title>
		<link>http://holsson.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://holsson.wordpress.com/osd.xml" title="Henrik Olsson&#039;s Computer Software Notes" />
	<atom:link rel='hub' href='http://holsson.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Upgrading old Visual Studio Solutions</title>
		<link>http://holsson.wordpress.com/2012/02/10/upgrading-old-visual-studio-solutions/</link>
		<comments>http://holsson.wordpress.com/2012/02/10/upgrading-old-visual-studio-solutions/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 13:00:04 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[.NET development]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/?p=199</guid>
		<description><![CDATA[I recently had to upgrade some old Visual Studio 2003 (!) solutions and projects to Visual Studio 2010. I tried to do that just by opening the solution and let the conversion wizard to its job. I had some challenges &#8230; <a href="http://holsson.wordpress.com/2012/02/10/upgrading-old-visual-studio-solutions/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=199&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently had to upgrade some old Visual Studio 2003 (!) solutions and projects to Visual Studio 2010. I tried to do that just by opening the solution and let the conversion wizard to its job. I had some challenges with the web application projects, including the old style web services.</p>
<p>The first lesson was to delete the project.csproj.webinfo file, because it contains an invalid reference to the project file, e.g.</p>
<p>&lt;VisualStudioUNCWeb&gt;<br />&nbsp;&nbsp;&nbsp; &lt;Web URLPath = &#8220;<a href="http://localhost/ExportWS/ExportWS.csproj&quot;">http://localhost/ExportWS/ExportWS.csproj&#8221;</a> /&gt;<br />&lt;/VisualStudioUNCWeb&gt;</p>
<p>Since the web site hadn&#8217;t been created, this URL was invalid.</p>
<p>Then, after the conversion, in one solution, I got the following error when re-opening the solution:</p>
<blockquote><p>The following Web projects must be converted to the new Web Site format. The conversion process will remove all source control binding and the project will not be under source control after migration.</p>
</blockquote>
<p>And then:</p>
<blockquote><p>One or more projects in the solution were not loaded correctly. Please see the Output Window for details.</p>
</blockquote>
<p>The output window contained the following error:</p>
<blockquote><p>Some of the properties associated with the solution could not be read.</p>
</blockquote>
<p>It turned out that the solution file had been corrupted. There were two extra GlobalSections. First there were:</p>
<blockquote><p>GlobalSection(TeamFoundationVersionControl) = preSolution<br />&nbsp;&nbsp;&nbsp; SccNumberOfProjects = 12<br />&nbsp;&nbsp;&nbsp; &#8230;<br />EndGlobalSection<br />GlobalSection(SolutionConfigurationPlatforms) = preSolution<br />&nbsp;&nbsp;&nbsp; Debug|Any CPU = Debug|Any CPU<br />&nbsp;&nbsp;&nbsp; Release|Any CPU = Release|Any CPU<br />EndGlobalSection<br />GlobalSection(ProjectConfigurationPlatforms) = postSolution<br />&nbsp;&nbsp;&nbsp; &#8230;<br />EndGlobalSection<br />GlobalSection(SolutionProperties) = preSolution<br />&nbsp;&nbsp;&nbsp; HideSolutionNode = FALSE<br />EndGlobalSection</p>
</blockquote>
<p>But then, were were two extra GlobalSections:</p>
<blockquote><p>GlobalSection(TeamFoundationVersionControl) = preSolution<br />&nbsp;&nbsp;&nbsp; SccNumberOfProjects = 12<br />&nbsp;&nbsp; &#8230;<br />EndGlobalSection<br />GlobalSection(TeamFoundationVersionControl) = preSolution<br />&nbsp;&nbsp;&nbsp; &#8230;<br />EndGlobalSection</p>
</blockquote>
<p>After removing these using Notepad, the above errors went away.</p>
<p>In another solution, each time I opened it I got a dialog saying the web projects must be converted to the new format. I found the solution here: <a title="http://connect.microsoft.com/VisualStudio/feedback/details/334842/repeated-conversion-of-project-file" href="http://connect.microsoft.com/VisualStudio/feedback/details/334842/repeated-conversion-of-project-file">http://connect.microsoft.com/VisualStudio/feedback/details/334842/repeated-conversion-of-project-file</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=199&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2012/02/10/upgrading-old-visual-studio-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>
	</item>
		<item>
		<title>Error Upgrading Database Project Using Visual Studio 2010</title>
		<link>http://holsson.wordpress.com/2012/02/07/error-upgrading-database-project-using-visual-studio-2010/</link>
		<comments>http://holsson.wordpress.com/2012/02/07/error-upgrading-database-project-using-visual-studio-2010/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 07:31:50 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[.NET development]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/?p=196</guid>
		<description><![CDATA[I recently upgraded a database project (.dbp file) to Visual Studio 2010. All I got was an error saying &#8220;database project not converted&#8221; and &#8220;Illegal characters in path&#8221;. I turned out that the project file was in ANSI encoding and &#8230; <a href="http://holsson.wordpress.com/2012/02/07/error-upgrading-database-project-using-visual-studio-2010/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=196&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded a database project (.dbp file) to Visual Studio 2010. All I got was an error saying &#8220;database project not converted&#8221; and &#8220;Illegal characters in path&#8221;. I turned out that the project file was in ANSI encoding and referred to files which had national characters (å, ä and ö). In these cases, the entries in the project file had special formatting: </p>
<blockquote><p>Script = &#8220;|file name|lots of hexadecimal digits&#8221;</p>
</blockquote>
<p>e.g.</p>
<blockquote><p>Script = &#8220;|20060111 Update COUNTYCOUNCIL Götaland Shortname .sql|00320030003000360030003100310031002000550070006400610074006500200043004f0055004e005400590043004f0055004e00430049004c0020004700f600740061006c0061006e0064002000530068006f00720074006e0061006d00650020002e00730071006c&#8221;</p>
</blockquote>
<p>What I did was to remove the vertical bars and the hexadecimal string, and saved the file with UTF-8 encoding. Then there was no problem upgrading it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=196&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2012/02/07/error-upgrading-database-project-using-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>
	</item>
		<item>
		<title>&quot;Flasha&quot; och konfigurera Dreambox (DM500HD)</title>
		<link>http://holsson.wordpress.com/2011/12/30/flasha-och-konfigurera-dreambox-dm500hd/</link>
		<comments>http://holsson.wordpress.com/2011/12/30/flasha-och-konfigurera-dreambox-dm500hd/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 20:02:20 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DM500HD]]></category>
		<category><![CDATA[Dreambox]]></category>
		<category><![CDATA[Enigma2]]></category>
		<category><![CDATA[OpenPLI]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/?p=190</guid>
		<description><![CDATA[Detta är främst anteckningar för min egen användning. &#8220;Flasha&#8221; Ladda ned senaste bygget från http://openpli.org/. Stäng av Dreamboxen med knappen på baksidan. Tryck in knappen på framsidan, håll in den och sätt samtidigt på med knappen på baksidan. Grön text &#8230; <a href="http://holsson.wordpress.com/2011/12/30/flasha-och-konfigurera-dreambox-dm500hd/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=190&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Detta är främst anteckningar för min egen användning.</p>
<h1>&#8220;Flasha&#8221;</h1>
<p>Ladda ned senaste bygget från <a title="http://openpli.org/" href="http://openpli.org/">http://openpli.org/</a>.</p>
<p>Stäng av Dreamboxen med knappen på baksidan. Tryck in knappen på framsidan, håll in den och sätt samtidigt på med knappen på baksidan. Grön text dyker upp på skärmen.</p>
<p>Gå till Dreamboxen med webbläsare (<a href="http://dm500hd/">http://dm500hd/</a> eller via IP-adress <a href="http://192.168.0.183">http://192.168.0.183</a>). Nu kan du ladda upp nfi-filen till Dreamboxen.</p>
<h1>Konfigurera</h1>
<h2>Mottagare och kanaler</h2>
<p>Först måste mottagaren konfigureras.</p>
<ul>
<li>Viasat sänder via Astra 4A (4.8E). Jag har denna på port A.</li>
<li>Canal Digital sänder via Thor 5/6/Intelsat 10-02 (0.8W). Jag har denna på port B.</li>
</ul>
<p>(Om du vill generera en ny inställningsfil <a href="//\\dm500hd\Root\etc\satellites.xml">\\dm500hd\Root\etc\satellites.xml</a>, gå till <a title="http://satellites-xml.eu/" href="http://satellites-xml.eu/">http://satellites-xml.eu/</a>.)</p>
<p>På huvudmenyn, gå till Installation –&gt; Kanalsökning –&gt;Tunerkonfiguration. Välj:</p>
<ul>
<li>Konfigurationsläge: enkelt</li>
<li>Läge: DiSEqC A/B</li>
<li>Port A: 4.8E Astra 4A</li>
<li>Port B: 0.8W Intelsat 10-02..Thor 5/6 Ku Band</li>
</ul>
<p>Kör en automatisk sökning.</p>
<p>Använd <a href="http://dreamboxedit.digsat.net/index.html">DreamBoxEdit</a> för att redigera kanallistan.</p>
<h2>SoftCam</h2>
<p>Gå till Plugins på huvudmenyn. Tryck på den gröna knappen och ladda ned CCCam.</p>
<p>Välj nu Installation, SoftCam / CI och konfigurera.</p>
<h2>Tillägg</h2>
<p>Gå till Installation –&gt; Mjukvaruhantering –&gt; Hantera utökningar. Ladda ned:</p>
<ul>
<li>systemplugins –&gt; autoresolution. Ställ in genom att gå till Installation –&gt; System –&gt; Autoresolution.</li>
</ul>
<h2>Nätverksmontering</h2>
<p>Gå till Installation –&gt; System –&gt; Nätverk –&gt; Nätverksbläddring. Välj HPSERVER och användarnamn Dreambox och lösenord *******. Bläddra fram Recorded TV och välj OK. I monteringseditorn ska inställningarna vara:</p>
<ul>
<li>Monteringstyp: CIFS-delning</li>
<li>Server-delning: Recorded TV</li>
<li>använda som HDD-ersättning: ja</li>
<li>Montineringsoptioner: rw</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=190&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/12/30/flasha-och-konfigurera-dreambox-dm500hd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>
	</item>
		<item>
		<title>Claims from Different Providers</title>
		<link>http://holsson.wordpress.com/2011/10/21/claims-from-different-providers/</link>
		<comments>http://holsson.wordpress.com/2011/10/21/claims-from-different-providers/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 08:48:36 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Windows Identity Foundation]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/2011/10/21/claims-from-different-providers/</guid>
		<description><![CDATA[This is a compilation of claims that are sent from different providers when using Windows Azure Access Control Service. Windows Live ID The only two claims from Windows Live ID are: Claim Type Example Value http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name iLO4AOwdo6pSpVSmKYiwL4/xIBGYHl/5f7vV/km/2lg= http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider uri:WindowsLiveID Google &#8230; <a href="http://holsson.wordpress.com/2011/10/21/claims-from-different-providers/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=185&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a compilation of claims that are sent from different providers when using Windows Azure Access Control Service.</p>
<h1>Windows Live ID</h1>
<p>The only two claims from Windows Live ID are:</p>
<table border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<th valign="top">Claim Type</th>
<th valign="top">Example Value</th>
</tr>
<tr>
<td valign="top">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name</td>
<td valign="top">iLO4AOwdo6pSpVSmKYiwL4/xIBGYHl/5f7vV/km/2lg=</td>
</tr>
<tr>
<td valign="top">http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider</td>
<td valign="top">uri:WindowsLiveID</td>
</tr>
</tbody>
</table>
<h1>Google</h1>
<table border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<th valign="top">Claim Type</th>
<th valign="top">Example Value</th>
</tr>
<tr>
<td valign="top">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier</td>
<td valign="top">https://www.google.com/accounts/o8/id?id=AItOawlREZ6oNiBdgeonz18vU93d2KqfH3VhH7o</td>
</tr>
<tr>
<td valign="top">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress</td>
<td valign="top">henrik.olsson@somedomain.com</td>
</tr>
<tr>
<td valign="top">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name</td>
<td valign="top">Henrik Olsson</td>
</tr>
<tr>
<td valign="top">http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider</td>
<td valign="top">Google</td>
</tr>
</tbody>
</table>
<h1>ADFS 2.0</h1>
<p>With ADFS 2.0, you can configure which AD attributes are mapped using claim rules. This is a sample mapping:</p>
<table border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<th valign="top">LDAP Attribute</th>
<th valign="top">Outgoing Claim Type</th>
<th valign="top">Example Value</td>
</th>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod</td>
<td valign="top">http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/windows</td>
</tr>
<tr>
<td valign="top">Display-Name</th>
<td valign="top">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name</td>
<td valign="top">Henrik Olsson</td>
</tr>
<tr>
<td valign="top">E-Mail-Addresses</td>
<td valign="top">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress</td>
<td valign="top">henrik.olsson@somedomain.com</td>
</tr>
<tr>
<td valign="top">User-Principal-Name</td>
<td valign="top">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn</td>
<td valign="top">holsson@somedomain.com</td>
</tr>
<tr>
<td valign="top">Token-Groups – Unqualified names</td>
<td valign="top">http://schemas.microsoft.com/ws/2008/06/identity/claims/role</td>
<td valign="top">Domain Users</td>
</tr>
<tr>
<td valign="top">SAM-Account-Name</td>
<td valign="top">http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname</td>
<td valign="top">holsson</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=185&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/10/21/claims-from-different-providers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>
	</item>
		<item>
		<title>Converting a Flash Video File for Windows Phone 7</title>
		<link>http://holsson.wordpress.com/2011/09/29/converting-a-flash-video-file-for-windows-phone-7/</link>
		<comments>http://holsson.wordpress.com/2011/09/29/converting-a-flash-video-file-for-windows-phone-7/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 09:38:47 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MP4]]></category>
		<category><![CDATA[VLC Player]]></category>
		<category><![CDATA[Windows Live Movie Maker]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/?p=183</guid>
		<description><![CDATA[I wanted to be able to view a downloaded video in Flash video format (.flv) on my Windows Phone 7. This proved to be somewhat of a challenge. After installing the Windows 7 Codec Pack, I could open the file &#8230; <a href="http://holsson.wordpress.com/2011/09/29/converting-a-flash-video-file-for-windows-phone-7/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=183&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to be able to view a downloaded video in Flash video format (.flv) on my Windows Phone 7. This proved to be somewhat of a challenge. After installing the <a href="http://www.windows7codecs.com/">Windows 7 Codec Pack</a>, I could open the file in Windows Live Movie Maker, but it froze when I tried to save it to Windows Media Video format (.wmv). So I searched around and found out that <a href="http://www.videolan.org/vlc/">VLC Player</a> could do the conversion.</p>
<p>My first attempt was to select Media-&gt;Convert/Save, select my input file, press the Convert/Save button, enter an output file with .mp4 extension and select profile <em>Video – H.264 + AAC (MP4)</em>. The video was converted all right, but there was no sound. After running with messages turned on (Tools-&gt;Messages, Verbosity Level 2) I saw the following error messages: &#8220;main error: Failed to create audio filter&#8221; and &#8220;stream_out_transcode error: Failed to find conversion filter for resampling&#8221;. It turned out that the source sample rate was 48 kHz, but the target was 44.1 kHz, and VLC was unable to resample. (Tip: Use <a href="http://mediainfo.sourceforge.net/">MediaInfo</a> to see what your file really contains.)</p>
<p>So I had to change the profile to use 48 kHz sample rate, but in this case, since both the Flash video container and the MP4 container use the same audio format (AAC) I could just check <em>Keep original audio track</em>.</p>
<p><a href="http://holsson.files.wordpress.com/2011/09/image2.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://holsson.files.wordpress.com/2011/09/image_thumb2.png?w=602&#038;h=487" width="602" height="487"></a></p>
<p>Save output to a Windows video library folder (e.g. &#8220;My Videos&#8221;) so that it shows up in the Zune videos collection. Now you should be able to sync it to the phone.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=183&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/09/29/converting-a-flash-video-file-for-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>

		<media:content url="http://holsson.files.wordpress.com/2011/09/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Sorting View Model Items Using CollectionViewSource</title>
		<link>http://holsson.wordpress.com/2011/09/26/sorting-view-model-items-using-collectionviewsource/</link>
		<comments>http://holsson.wordpress.com/2011/09/26/sorting-view-model-items-using-collectionviewsource/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 15:57:26 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/?p=176</guid>
		<description><![CDATA[If you create a Windows Phone 7 data bound application using the template, the item list is not sorted. I found that the simplest way to do that is to use System.Windows.Data.CollectionViewSource. The example on MSDN is perhaps not so &#8230; <a href="http://holsson.wordpress.com/2011/09/26/sorting-view-model-items-using-collectionviewsource/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=176&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you create a Windows Phone 7 data bound application using the template, the item list is not sorted. I found that the simplest way to do that is to use <a href="http://msdn.microsoft.com/en-us/library/ms613527.aspx">System.Windows.Data.CollectionViewSource</a>. The example on MSDN is perhaps not so helpful, since a static resources are used. You would typically want to bind to dynamic data. I found the solution in a blog post called <a title="Use CollectionViewSource effectively in MVVM applications" href="http://silverlightplayground.org/post/2009/07/18/Use-CollectionViewSource-effectively-in-MVVM-applications.aspx">Use CollectionViewSource effectively in MVVM applications</a>, but decided to implement it a little different. Here is what I did:</p>
<p>In MainViewModel.cs, I kept the Items property of type ObservableCollection&lt;T&gt; and created a new property called SortedItems of type CollectionViewSource:</p>
<pre>public CollectionViewSource SortedItems { get; private set; }</pre>
<p>The getter of Items returns the CollectionViewSource Source, and the setter of Items updates the CollectionViewSource Source:</p>
<pre>       using AccountCollection = ObservableCollection&lt;Account&gt;;

       public AccountCollection Items
        {
            get { return (AccountCollection)SortedItems.Source; }
            private set
            {
                var items = (AccountCollection)SortedItems.Source;
                items.Clear();
                foreach (var item in value)
                {
                    items.Add(item);
                }
             }
         }</pre>
<p>In the MainViewModel constructor, I initialize the CollectionViewSource and tell it to sort ascending on a property called Name:</p>
<pre>        public MainViewModel()
        {
            this.SortedItems = new CollectionViewSource();
            this.SortedItems.Source = new AccountCollection();
            this.SortedItems.SortDescriptions.Add(new System.ComponentModel.SortDescription("Name", System.ComponentModel.ListSortDirection.Ascending));
        }</pre>
<p>Then I changed the binding in MainPage.xaml like this:</p>
<pre>&lt;ListBox x:Name="MainListBox" Margin="0,0,-12,0" ItemsSource="{Binding SortedItems.View}"&gt;</pre>
<p>#yam</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=176&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/09/26/sorting-view-model-items-using-collectionviewsource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>
	</item>
		<item>
		<title>Retrieving Entity Data Using JScript</title>
		<link>http://holsson.wordpress.com/2011/09/21/retrieving-entity-data-using-jscript/</link>
		<comments>http://holsson.wordpress.com/2011/09/21/retrieving-entity-data-using-jscript/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 14:28:42 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[JScript]]></category>
		<category><![CDATA[OData]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/2011/09/21/retrieving-entity-data-using-jscript/</guid>
		<description><![CDATA[This is a step-by-step recipe for retrieving CRM entity data using JScript and the OData (REST) endpoint in an asynchronous manner. 1. Install JScript Editor Extensions  in Visual Studio. 2. Install Visual Studio project template by double-clicking SDK\Templates\XrmPageScriptDevelopmentProjectCS.vsix. 3. Import &#8230; <a href="http://holsson.wordpress.com/2011/09/21/retrieving-entity-data-using-jscript/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=173&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a step-by-step recipe for retrieving CRM entity data using JScript and the OData (REST) endpoint in an asynchronous manner.</p>
<p>1. Install <a href="http://visualstudiogallery.msdn.microsoft.com/872d27ee-38c7-4a97-98dc-0d8a431cc2ed/"><em>JScript Editor Extensions</em></a>  in Visual Studio.</p>
<p>2. Install Visual Studio project template by double-clicking <em>SDK\Templates\XrmPageScriptDevelopmentProjectCS.vsix</em>.</p>
<p>3. Import <em>SDK\Templates\Xrm.PageScriptProjectTemplate\XrmPageScriptDevelopmentFormSnapshot_1_0_0_0_managed.zip</em> in CRM.</p>
<p>4. Create a new project and select the <em>Xrm.Page JScript Library Project</em> template.</p>
<p>5. Open an instance of the form, in my case the Quote Product form, and click <em>Xrm.Page</em> on the <em>Customize</em> tab.</p>
<p>6. Click <em>Get Data</em> and then <em>Copy to Clipboard</em>.</p>
<p>7. In your Visual Studio project, replace the contents of <em>PageData.js</em> with the contents of your clipboard.</p>
<p>8. Add a new JScript file called e.g. <em>Product.js</em> with following contents:</p>
<p><span style="font-family:Consolas;"><span style="color:#006400;">/// &lt;reference path=&#8221;XrmPageTemplate.js&#8221; /&gt;</span><br />
<span style="color:#006400;">/// &lt;reference path=&#8221;SDK.JScriptRESTDataOperations.js&#8221; /&gt;</span><br />
<span style="color:#0000ff;">function</span> retrieveProduct() {<br />
// This assumes there is a lookup field called productid that contains the selected product.<br />
<span style="color:#0000ff;">var</span> lookup = Xrm.Page.getAttribute(<span style="color:#800000;">&#8220;productid&#8221;</span>).getValue();<br />
<span style="color:#0000ff;">var</span> id = lookup[0].id;<br />
SDK.JScriptRESTDataOperations.Retrieve(<br />
id,<br />
<span style="color:#800000;">&#8220;Product&#8221;</span>,<br />
<span style="color:#0000ff;">function</span> (product) {<br />
alert(<span style="color:#800000;">&#8220;Retrieved the product named \&#8221;"</span> + product.Name + <span style="color:#800000;">&#8220;\&#8221;. This product was created on : \&#8221;"</span> + product.CreatedOn + <span style="color:#800000;">&#8220;\&#8221;.&#8221;</span>);<br />
},<br />
errorHandler<br />
);<br />
}</p>
<p><span style="color:#0000ff;">function</span> errorHandler(error)  {<br />
alert(error.message);<br />
} </span></p>
<p>9. In your CRM solution, add the following web resources:</p>
<ul>
<li>/Scripts/jquery1.4.1.min.js (from sdk\samplecode\js\restendpoint\jqueryrestdataoperations\jqueryrestdataoperations\scripts)</li>
<li>/Scripts/json2.js (from sdk\samplecode\js\restendpoint\jqueryrestdataoperations\jqueryrestdataoperations\scripts)</li>
<li>/Scripts/Product.js (the code above)</li>
<li>/Scripts/SDK.JScriptRESTDataOperations.js (code from <a title="http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/f501c019-aa7f-4d78-8390-5f11d1dd8820" href="http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/f501c019-aa7f-4d78-8390-5f11d1dd8820">http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/f501c019-aa7f-4d78-8390-5f11d1dd8820</a>)</li>
</ul>
<p>10. Add these web resources as libraries on the form.</p>
<p>11. Add a call to <em>retrieveProduct</em> e.g. on the <em>productid</em> <em>OnChange</em> event.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=173&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/09/21/retrieving-entity-data-using-jscript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello, Claims!</title>
		<link>http://holsson.wordpress.com/2011/09/05/hello-claims/</link>
		<comments>http://holsson.wordpress.com/2011/09/05/hello-claims/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 13:57:36 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Windows Identity Foundation]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/2011/09/05/hello-claims/</guid>
		<description><![CDATA[This a step-by-step guide for converting a ASP.NET web application to claims-based authentication using Windows Identity Foundation and ADFS 2.0. It assumes you have a development environment consisting of Visual Studio 2010 with ASP.NET MVC 3 and Windows Identity Foundation &#8230; <a href="http://holsson.wordpress.com/2011/09/05/hello-claims/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=163&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This a step-by-step guide for converting a ASP.NET web application to claims-based authentication using Windows Identity Foundation and ADFS 2.0. It assumes you have a development environment consisting of Visual Studio 2010 with ASP.NET MVC 3 and Windows Identity Foundation SDK. You also need ADFS 2.0  &#8211; in my case I installed it on a virtual machine (called <em>testad1</em>) which is also domain controller (domain <em>test1.se</em>).</p>
<p>(Depending on your network setup, you may have to enter the FQN of the virtual machine, <em>testad1.test1.se</em> in my case, in the host <em>C:\Windows\System32\Drivers\etc\hosts</em> file.)</p>
<h1>Create a Web Application with Forms Authentication</h1>
<p>Create an ASP.NET MVC 3 Web Application (<em>HelloClaimsWeb</em>) and choose the Internet Application template and the Razor view engine.</p>
<p>Make sure IIS Default Web Site has application pool ASP.NET 4.0.</p>
<p>Publish the application to IIS.</p>
<p><a href="http://holsson.files.wordpress.com/2011/09/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://holsson.files.wordpress.com/2011/09/image_thumb.png?w=570&#038;h=820" alt="image" width="570" height="820" border="0" /></a></p>
<p>Test the web application (<a href="https://hostname/HelloClaimsWeb/">https://hostname/HelloClaimsWeb/</a>). Notice that the user name is displayed in the upper right corner.</p>
<p>Enable the <em>World Wide Web Services</em> rules in Windows Firewall.</p>
<p>Test the web application from the test domain (virtual machine).</p>
<h1>Convert to Claims Based Authentication</h1>
<p>Run the Federation Utility:</p>
<ul>
<li>Enter the location of your <em>web.config</em> (the one in your Visual Studio project) and application URI <a href="https://hostname/HelloClaimsWeb/">https://hostname/HelloClaimsWeb/</a>.</li>
<li>Choose <em>Use an existing STS</em> and WS-Federation metadata document location <a href="https://testad1.test1.se/FederationMetadata/2007-06/FederationMetadata.xml">https://testad1.test1.se/FederationMetadata/2007-06/FederationMetadata.xml</a>.</li>
<li>Choose <em>Disable certificate chain validation</em>.</li>
<li>Choose <em>No encryption</em>.</li>
</ul>
<p>Then, publish the application to IIS again.</p>
<h2>Changes Made by the Federation Utility</h2>
<p>The utility is not some kind of magic – it makes some changes to web.config. From top to bottom:</p>
<p>It adds a new section in configSections:</p>
<pre>  &lt;configSections&gt;
      &lt;section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
  &lt;/configSections&gt;</pre>
<p>(More on this later.)</p>
<p>It adds a new application setting which points to the STS federation metadata document location:</p>
<pre>    &lt;add key="FederationMetadataLocation" value="https://testad1.test1.se/FederationMetadata/2007-06/FederationMetadata.xml" /&gt;</pre>
<p>Then there is an important change:</p>
<pre>    &lt;authentication mode="Forms" /&gt;</pre>
<p>is changed to</p>
<pre>    &lt;authentication mode="None" /&gt;</pre>
<p>This is because authentication is moved to a different part of the http pipeline. The following http modules are added in &lt;system.web&gt;:</p>
<pre>    &lt;httpModules&gt;
         &lt;add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
         &lt;add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
    &lt;/httpModules&gt;</pre>
<p>The <em>WSFederationAuthenticationModule</em> redirects the user to the identity provider’s logon page. It also parses and validates the security token that is posted back. This module writes an encrypted cookie to avoid repeating the logon process. The <em>SessionAuthenticationModule</em> detects the logon cookie, decrypts it, and constructs the <em>ClaimsPrincipal</em> object.</p>
<p>These modules are also added to &lt;system.webserver&gt;:</p>
<pre>    &lt;modules runAllManagedModulesForAllRequests="true"&gt;
         &lt;add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" /&gt;
         &lt;add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" /&gt;
    &lt;/modules&gt;</pre>
<p>Then, there is the large <em>microsoft.identitymodel</em> section:</p>
<pre>  &lt;microsoft.identityModel&gt;
     &lt;service&gt;
       &lt;audienceUris&gt;
         &lt;add value="https://&lt;hostname&gt;/HelloClaimsWeb/" /&gt;
       &lt;/audienceUris&gt;
       &lt;federatedAuthentication&gt;
         &lt;wsFederation passiveRedirectEnabled="true" issuer="https://testad1.test1.se/adfs/ls/" realm="https://stc11118m1.softronic.se/HelloClaimsWeb/" requireHttps="true" /&gt;
         &lt;cookieHandler requireSsl="true" /&gt;
       &lt;/federatedAuthentication&gt;
       &lt;applicationService&gt;
         &lt;claimTypeRequired&gt;
           &lt;!--Following are the claims offered by STS 'http://TestAD1.test1.se/adfs/services/trust'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.—&gt;
           &lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" /&gt;
           &lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" /&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/claims/CommonName" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/claims/EmailAddress" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/claims/Group" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/claims/UPN" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid" optional="true" /&gt;—&gt;
           &lt;!--&lt;claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname" optional="true" /&gt;—&gt;
         &lt;/claimTypeRequired&gt;
       &lt;/applicationService&gt;
       &lt;issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
         &lt;trustedIssuers&gt;
           &lt;add thumbprint="BA264CE398B297029466B7C547D4A2FB8B285991" name="http://TestAD1.test1.se/adfs/services/trust" /&gt;
         &lt;/trustedIssuers&gt;
       &lt;/issuerNameRegistry&gt;
       &lt;certificateValidation certificateValidationMode="None" /&gt;
     &lt;/service&gt;
   &lt;/microsoft.identityModel&gt;</pre>
<h1>Configure ADFS 2.0</h1>
<p>If you try to browse the web application now, you will get an error.</p>
<p>In the AD FS 2.0 Management console, add a new relying party trust.</p>
<ul>
<li>Choose Import data about the relying party from a file and specify the file with path <em>&lt;web project folder&gt;\FederationMetadata\2007-06\FederationMetadata.xml</em>.</li>
<li>Type a display name, e.g. <em>HelloClaimsWeb</em>.</li>
</ul>
<p>Add a new transform rule:</p>
<ul>
<li>Select claim rule template Send LDAP Attributes as Claims.</li>
<li>As claim rule name, type <em>LDAP attributes</em>.</li>
<li>Select <em>Active Directory</em>as attribute store.</li>
<li>Map from <em>Display-Name</em> to <em>Name</em> and from <em>Token-Groups – Unqualified Names</em> to <em>Role</em>.</li>
</ul>
<h1>Code Changes</h1>
<p>Modify the home page to display the collection of claims as follows:</p>
<p>Add a reference to <em>Microsoft.IdentityModel</em>.</p>
<p>Change <em>HomeController.Index</em> with the following code:</p>
<pre>            var principal = Thread.CurrentPrincipal;
            var identity = principal.Identity as IClaimsIdentity;
            var claims = identity.Claims;
            return View(claims);</pre>
<p>Change the index view (<em>Index.cshtml</em>) as follows:</p>
<pre>&lt;p&gt;    
    @{
        var grid = new WebGrid(Model);
        @grid.GetHtml(columns: grid.Columns(grid.Column("ClaimType"), grid.Column("Value")));
    }
&lt;/p&gt;</pre>
<p>Now if you run the web application from the virtual machine, you will get the following error:</p>
<blockquote><p>A potentially dangerous Request.Form value was detected from the client (wresult=&#8221;&lt;t:RequestSecurityTo&#8230;&#8221;).</p></blockquote>
<p>This is described in detail in <a href="http://www.asp.net/learn/whitepapers/request-validation">Request Validation &#8211; Preventing Script Attacks</a> and the solution in this article: <a title="http://social.technet.microsoft.com/wiki/contents/articles/windows-identity-foundation-wif-a-potentially-dangerous-request-form-value-was-detected-from-the-client-wresult-quot-lt-t-requestsecurityto-quot.aspx" href="http://social.technet.microsoft.com/wiki/contents/articles/windows-identity-foundation-wif-a-potentially-dangerous-request-form-value-was-detected-from-the-client-wresult-quot-lt-t-requestsecurityto-quot.aspx">http://social.technet.microsoft.com/wiki/contents/articles/windows-identity-foundation-wif-a-potentially-dangerous-request-form-value-was-detected-from-the-client-wresult-quot-lt-t-requestsecurityto-quot.aspx</a></p>
<h1>Moving the Web Application to the Cloud</h1>
<h2>Create Windows Azure Project</h2>
<p>Add a new project of type Windows Azure and call it <em>HelloClaimsCloud</em>. Right-click on Roles and add <em>Web Role Project in Solution</em>.</p>
<p>Right-click on the newly added role and select <em>Properties</em>. Change VM size to <em>Extra small</em>.</p>
<p>Follow the following guide to add MVC dependencies: <a title="http://msdn.microsoft.com/en-us/library/hh369932.aspx#PublishMVC" href="http://msdn.microsoft.com/en-us/library/hh369932.aspx#PublishMVC">http://msdn.microsoft.com/en-us/library/hh369932.aspx#PublishMVC</a></p>
<p><a href="http://holsson.files.wordpress.com/2011/09/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://holsson.files.wordpress.com/2011/09/image_thumb1.png?w=573&#038;h=305" alt="image" width="573" height="305" border="0" /></a></p>
<p>You must now delete the four WebMatrix files in <em>_bin_DeployableAssemblies</em>; otherwise the web application tries to redirect to ~/Account/Login.</p>
<p>Then, set reference <em>Microsoft.IdentityModel</em> property <em>Copy Local</em> to <em>True</em>.</p>
<h2>Create and Use SSL Certificate</h2>
<p>Start a Visual Studio command prompt and create a certificate using makecert:</p>
<blockquote><p>makecert -r -pe -n &#8220;CN=helloclaims.cloudapp.net&#8221; -b 01/01/2010 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp &#8220;Microsoft RSA SChannel Cryptographic Provider&#8221; -sy 12</p></blockquote>
<p>Right-click the <em>HelloClaimsWeb</em> role and select properties. Select the <em>Certificates</em> tab. Add the newly created certificate. Then switch to the <em>Endpoints</em> tab and add a new endpoint with protocol https, port 443 and the certificate just added.</p>
<p>Then export the certificate, including private key, and upload it as a service certificate using the Windows Azure Platform Management Portal.</p>
<p>Reconfigure the Application</p>
<p>In web.config, there are a couple of entries that specifies the application URL. These must be changed. For that purpose, create a new project and solution configuration and call it e.g. <em>Cloud</em>. Right-click on <em>web.config</em> and select <em>Add Config Transforms</em>. Then, edit <em>Web.Cloud.config</em> and add the following before <em>&lt;/configuration&gt;</em>:</p>
<pre>  &lt;microsoft.identityModel&gt;
    &lt;service&gt;
      &lt;audienceUris&gt;
        &lt;add value="https://helloclaims.cloudapp.net/" xdt:Transform="Replace"/&gt;
      &lt;/audienceUris&gt;
      &lt;federatedAuthentication&gt;
        &lt;wsFederation realm="https://helloclaims.cloudapp.net/" xdt:Transform="SetAttributes(realm)"/&gt;
      &lt;/federatedAuthentication&gt;
    &lt;/service&gt;
  &lt;/microsoft.identityModel&gt;</pre>
<p>Build and deploy this configuration to Windows Azure.</p>
<h2>Configure ADFS 2.0</h2>
<p>In the AD FS 2.0 Management console, add a new relying party trust.</p>
<ul>
<li>Take a copy of the existing application federation metadata file (<em>&lt;web project folder&gt;\FederationMetadata\2007-06\FederationMetadata.xml</em>).</li>
<li>Edit the copy and change all three instances of the old URL (<a href="https://hostname/HelloClaimsWeb/">https://hostname/HelloClaimsWeb/</a>) to the cloud URL (<a href="https://helloclaims.cloudapp.net/">https://helloclaims.cloudapp.net/</a> in my case).</li>
<li>Choose Import data about the relying party from a file and specify the new modified file.</li>
<li>Type a display name, e.g. <em>HelloClaimsCloud</em>.</li>
</ul>
<p>Add the same transform rule as before:</p>
<ul>
<li>Select claim rule template Send LDAP Attributes as Claims.</li>
<li>As claim rule name, type <em>LDAP attributes</em>.</li>
<li>Select <em>Active Directory </em>as attribute store.</li>
<li>Map from <em>Display-Name</em> to <em>Name</em> and from <em>Token-Groups – Unqualified Names</em> to <em>Role</em>.</li>
</ul>
<h1>References</h1>
<p><a href="http://www.davidchappell.com/writing/white_papers/Claims-Based_Identity_for_Windows_v3.0--Chappell.docx">Claims-Based Identity for Windows</a></p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=BB9AB270-473B-4852-B26E-031A88EDD113&amp;amp;amp;displaylang=e&amp;displaylang=en">AD FS 2.0 Federation with a WIF Application Step-by-Step Guide</a></p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1296E52C-D869-4F73-A112-8A37314A1632&amp;amp;amp;displaylang=e&amp;displaylang=en">Single Sign-On from Active Directory to a Windows Azure Application</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=163&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/09/05/hello-claims/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>

		<media:content url="http://holsson.files.wordpress.com/2011/09/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://holsson.files.wordpress.com/2011/09/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Dynamics CRM 2011 Online Integration Getting Started (Early Bound)</title>
		<link>http://holsson.wordpress.com/2011/08/25/microsoft-dynamics-crm-2011-online-integration-getting-started-early-bound/</link>
		<comments>http://holsson.wordpress.com/2011/08/25/microsoft-dynamics-crm-2011-online-integration-getting-started-early-bound/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 12:04:21 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/2011/08/25/microsoft-dynamics-crm-2011-online-integration-getting-started-early-bound/</guid>
		<description><![CDATA[This is a follow up to my previous post Microsoft Dynamics CRM 2011 Online Integration Getting Started (Late Bound). Here I list the steps that I had to do different to work with early binding. After creating the project, I &#8230; <a href="http://holsson.wordpress.com/2011/08/25/microsoft-dynamics-crm-2011-online-integration-getting-started-early-bound/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=158&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a follow up to my previous post <em>Microsoft Dynamics CRM 2011 Online Integration Getting Started (Late Bound)</em>. Here I list the steps that I had to do different to work with early binding.</p>
<p>After creating the project, I ran CrmSvcUtil.exe: </p>
<blockquote><p>&lt;location of sdk&gt;\bin\CrmSvcUtil.exe /url:https://xxx.api.crm4.dynamics.com/XRMServices/2011/Organization.svc /out:&#8221;C:\Users\henols02\Documents\Visual Studio 2010\Projects\&lt;project name&gt;\Models\CrmModel.cs&#8221; /namespace:&lt;project name&gt;.Models /serviceContextName:CrmServiceContext /username:&#8221;&lt;Windows Live ID&#8221; /password:&#8221;&lt;password&gt;&#8221;</p>
</blockquote>
<p>and added the resulting <em>CrmModel.cs</em> to the project in the <em>Models</em> folder.</p>
<p>After creating the service proxy (in <em>LogOn</em> method), early bound support had to be added using the following statement:</p>
<blockquote><p>serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new Microsoft.Xrm.Sdk.Client.ProxyTypesBehavior());</p>
</blockquote>
<p>In the created controller, getting the context and retrieving the data is done in a slightly different (simpler) way:</p>
<blockquote><p>var context = new Elevregister1.Models.CrmServiceContext(service);<br />var elever = context.elev_elevSet.ToList();</p>
</blockquote>
<p>I created the view as a strongly-type view:</p>
<p><a href="http://holsson.files.wordpress.com/2011/08/image3.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://holsson.files.wordpress.com/2011/08/image_thumb3.png?w=583&#038;h=666" width="583" height="666"></a></p>
<p>Then, I removed the unwanted columns.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=158&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/08/25/microsoft-dynamics-crm-2011-online-integration-getting-started-early-bound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>

		<media:content url="http://holsson.files.wordpress.com/2011/08/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Dynamics CRM 2011 Online Integration Getting Started (Late Bound)</title>
		<link>http://holsson.wordpress.com/2011/08/24/microsoft-dynamics-crm-2011-online-integration-getting-started-late-bound/</link>
		<comments>http://holsson.wordpress.com/2011/08/24/microsoft-dynamics-crm-2011-online-integration-getting-started-late-bound/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 17:02:49 +0000</pubDate>
		<dc:creator>Henrik Olsson</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>

		<guid isPermaLink="false">https://holsson.wordpress.com/2011/08/24/microsoft-dynamics-crm-2011-online-integration-getting-started-late-bound/</guid>
		<description><![CDATA[This is a log of what I did to create a very simple ASP.NET MVC application that retrieves data from Microsoft Dynamics CRM 2011 Online. I had a custom entity called Elev. 1. Created an ASP.NET MVC 3 Web Application &#8230; <a href="http://holsson.wordpress.com/2011/08/24/microsoft-dynamics-crm-2011-online-integration-getting-started-late-bound/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=152&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a log of what I did to create a very simple ASP.NET MVC application that retrieves data from Microsoft Dynamics CRM 2011 Online. I had a custom entity called <em>Elev</em>.</p>
<p>1. Created an ASP.NET MVC 3 Web Application with template Internet Application.</p>
<p>2. Added references to</p>
<ul>
<li>microsoft.crm.sdk.proxy</li>
<li>microsoft.xrm.sdk</li>
<li>System.ServiceModel</li>
<li>System.Runtime.Serialization</li>
<li>System.Security.</li>
</ul>
<p>3. Created a new folder called Helpers and add <em>&lt;location of sdk&gt;\samplecode\cs\helpercode\deviceidmanager.cs</em> to it.</p>
<p>4. Modified AccountController LogOn to create a CRM service proxy and store it in the user&#8217;s session:</p>
<blockquote><p>[HttpPost]<br />
public ActionResult LogOn(LogOnModel model, string returnUrl)<br />
{<br />
if (ModelState.IsValid)<br />
{<br />
//if (Membership.ValidateUser(model.UserName, model.Password))<br />
try<br />
{<br />
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);</p>
<p>// Added for CRM<br />
var clientCredentials = new System.ServiceModel.Description.ClientCredentials();<br />
clientCredentials.UserName.UserName = model.UserName;<br />
clientCredentials.UserName.Password = model.Password;<br />
var serviceProxy = new Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy(<br />
new Uri(&#8220;https://xxx.api.crm4.dynamics.com/XRMServices/2011/Organization.svc&#8221;),<br />
null,<br />
clientCredentials,<br />
Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice());<br />
Session.Add(&#8220;ServiceProxy&#8221;, serviceProxy);<br />
// End added for CRM</p>
<p>if (Url.IsLocalUrl(returnUrl) &amp;&amp; returnUrl.Length &gt; 1 &amp;&amp; returnUrl.StartsWith(&#8220;/&#8221;)<br />
&amp;&amp; !returnUrl.StartsWith(&#8220;//&#8221;) &amp;&amp; !returnUrl.StartsWith(&#8220;/\\&#8221;))<br />
{<br />
return Redirect(returnUrl);<br />
}<br />
else<br />
{<br />
return RedirectToAction(&#8220;Index&#8221;, &#8220;Home&#8221;);<br />
}<br />
}<br />
//else<br />
catch (Exception ex)<br />
{<br />
//ModelState.AddModelError(&#8220;&#8221;, &#8220;The user name or password provided is incorrect.&#8221;);<br />
ModelState.AddModelError(&#8220;&#8221;, ex);<br />
}<br />
}</p>
<p>// If we got this far, something failed, redisplay form<br />
return View(model);<br />
}</p></blockquote>
<p>5. Modified AccountController LogOff as follows:</p>
<blockquote><p>public ActionResult LogOff()<br />
{<br />
var serviceProxy = Session["ServiceProxy"] as Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy;<br />
if (serviceProxy != null)<br />
{<br />
Session.Remove(&#8220;ServiceProxy&#8221;);<br />
serviceProxy.Dispose();<br />
}</p>
<p>FormsAuthentication.SignOut();</p>
<p>return RedirectToAction(&#8220;Index&#8221;, &#8220;Home&#8221;);<br />
}</p></blockquote>
<p>6. Created a new controller with empty read/write actions called <em>ElevController</em>.</p>
<p><a href="http://holsson.files.wordpress.com/2011/08/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://holsson.files.wordpress.com/2011/08/image_thumb1.png?w=690&#038;h=507" alt="image" width="690" height="507" border="0" /></a></p>
<p>7. Added the following code:</p>
<blockquote><p>public ActionResult Index()<br />
{<br />
var service = Session["ServiceProxy"] as Microsoft.Xrm.Sdk.IOrganizationService;<br />
if (service != null)<br />
{<br />
var context = new Microsoft.Xrm.Sdk.Client.OrganizationServiceContext(service);<br />
var query = from e in context.CreateQuery(&#8220;elev_elev&#8221;) select e;<br />
var elever = query.ToList();<br />
return View(elever);<br />
}<br />
else<br />
{<br />
ModelState.AddModelError(&#8220;&#8221;, &#8220;ServiceProxy missing in session state. Did you log in?&#8221;);<br />
return RedirectToAction(&#8220;LogOn&#8221;, &#8220;Account&#8221;);<br />
}<br />
}</p></blockquote>
<p>8. Added a new folder in Views called <em>Elev</em>.</p>
<p>9. Added a new view called <em>Index</em>:</p>
<p><a href="http://holsson.files.wordpress.com/2011/08/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://holsson.files.wordpress.com/2011/08/image_thumb2.png?w=583&#038;h=666" alt="image" width="583" height="666" border="0" /></a></p>
<p>10. Added the following code:</p>
<blockquote><p>@model IEnumerable&lt;Microsoft.Xrm.Sdk.Entity&gt;</p>
<p>@{<br />
ViewBag.Title = &#8220;Index&#8221;;<br />
}</p>
<p>&lt;h2&gt;Index&lt;/h2&gt;</p>
<p>&lt;p&gt;<br />
@Html.ActionLink(&#8220;Ny&#8221;, &#8220;Create&#8221;)<br />
&lt;/p&gt;<br />
&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;th&gt;<br />
Namn<br />
&lt;/th&gt;<br />
&lt;th&gt;<br />
Personnummer<br />
&lt;/th&gt;<br />
&lt;/tr&gt;</p>
<p>@foreach (var item in Model) {<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
@Html.DisplayFor(modelItem =&gt; item["elev_name"])<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
@Html.DisplayFor(modelItem =&gt; item["elev_personnummer"])<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
@Html.ActionLink(&#8220;Redigera&#8221;, &#8220;Edit&#8221;, new { id=item.Id }) |<br />
@Html.ActionLink(&#8220;Detaljer&#8221;, &#8220;Details&#8221;, new { id = item.Id }) |<br />
@Html.ActionLink(&#8220;Ta bort&#8221;, &#8220;Delete&#8221;, new { id = item.Id })<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
}</p>
<p>&lt;/table&gt;</p></blockquote>
<p>11. Added a link on the Home/Index page:</p>
<blockquote><p>&lt;p&gt;@Html.ActionLink(&#8220;Elever&#8221;, &#8220;Index&#8221;, &#8220;Elev&#8221;)&lt;/p&gt;</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/holsson.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/holsson.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/holsson.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/holsson.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/holsson.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/holsson.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/holsson.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/holsson.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/holsson.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/holsson.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/holsson.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/holsson.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/holsson.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/holsson.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=holsson.wordpress.com&amp;blog=16196432&amp;post=152&amp;subd=holsson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://holsson.wordpress.com/2011/08/24/microsoft-dynamics-crm-2011-online-integration-getting-started-late-bound/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2dfc5c23fe846dee742c24ef92fc3b73?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">holsson</media:title>
		</media:content>

		<media:content url="http://holsson.files.wordpress.com/2011/08/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://holsson.files.wordpress.com/2011/08/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
