<?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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Martin Normark&#039;s blog &#187; Silverlight</title>
	<atom:link href="http://martinnormark.com/tag/silverlight/feed" rel="self" type="application/rss+xml" />
	<link>http://martinnormark.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 21:06:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Silverlight 2.0 provides better remote debugging experience</title>
		<link>http://martinnormark.com/silverlight-2-0-provides-better-remote-debugging-experience?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://martinnormark.com/silverlight-2-0-provides-better-remote-debugging-experience#comments</comments>
		<pubDate>Sun, 26 Oct 2008 01:25:04 +0000</pubDate>
		<dc:creator>Martin Normark</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">/post/Silverlight-20-provides-better-remote-debugging-experience.aspx</guid>
		<description><![CDATA[Some months ago, I did some remote debugging of a Silverlight app on a Mac. To say the least, it wasn’t all that intuitive, and it required a lot of trying and guessing to achieve the desired goal. Personally I &#8230; <p><a class="btn small" href="http://martinnormark.com/silverlight-2-0-provides-better-remote-debugging-experience">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>Some months ago, I did some <a href="http://www.martinnormark.com/post/Windows-Vista-Mac-debugging-a-Silverlight-app-using-Visual-Studio-2008.aspx">remote debugging of a Silverlight app on a Mac</a>. To say the least, it wasn’t all that intuitive, and it required a lot of trying and guessing to achieve the desired goal. Personally I think remote debugging is cool, but I can’t really see the great need of it. <a href="http://www.silverlight.net">Silverlight</a> is cross-browser, cross-platform compatible – so when it works in a browser on Windows, shouldn’t it work on a Mac as well?</p>
<p>The release of Silverlight 2.0 has some great news in respect to remote debugging. It is no longer necessary to edit config files, and so on to authenticate the remote debugging session. This is all done from a nice user interface. <a href="http://blogs.msdn.com/peterlau/default.aspx">JrzyShr Dev Guy</a> has a excellent <a href="http://blogs.msdn.com/peterlau/archive/2008/10/14/remote-debugging-a-silverlight-application-on-mac-osx.aspx">blog post describing the process of setting up remote debugging on a Mac on Silverlight 2.0</a>. Furthermore, he suggests I mark my post as obsolete:</p>
<blockquote><p>I ended up relying on a couple of random blog posts I came across on <a href="http://www.live.com">Live Search</a> &amp; Google to figure it out.  If your search turns up any of these links, know that they are now obsolete:</p>
<blockquote><p>Old 1.1 Alpha Way of Doing Things:<br />
<a href="http://www.martinnormark.com/post/Windows-Vista-Mac-debugging-a-Silverlight-app-using-Visual-Studio-2008.aspx">http://www.martinnormark.com/post/Windows-Vista-Mac-debugging-a-Silverlight-app-using-Visual-Studio-2008.aspx</a></p></blockquote>
</blockquote>
<p>So that I’ll do. Confusing information is all over the place, and I’d rather point someone in the right direction.</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:24f2f677-576f-4d0b-8cec-3e9e69d0b77e" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/silverlight">silverlight</a>,<a rel="tag" href="http://technorati.com/tags/web+development">web development</a>,<a rel="tag" href="http://technorati.com/tags/debugging">debugging</a></div>
]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/silverlight-2-0-provides-better-remote-debugging-experience/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Windows Vista / Mac debugging a Silverlight app using Visual Studio 2008</title>
		<link>http://martinnormark.com/windows-vista-mac-debugging-a-silverlight-app-using-visual-studio-2008?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://martinnormark.com/windows-vista-mac-debugging-a-silverlight-app-using-visual-studio-2008#comments</comments>
		<pubDate>Mon, 24 Dec 2007 00:38:00 +0000</pubDate>
		<dc:creator>Martin Normark</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">/post/Windows-Vista-Mac-debugging-a-Silverlight-app-using-Visual-Studio-2008.aspx</guid>
		<description><![CDATA[[obsolete] As I wrote here, this is no longer the way to do it as Silverlight 2.0 provides a much better experience. As I wrote recently in another blog post about a .NET Rocks interview with Brad Abrams, I was &#8230; <p><a class="btn small" href="http://martinnormark.com/windows-vista-mac-debugging-a-silverlight-app-using-visual-studio-2008">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p><em><strong>[obsolete]</strong><br />
<a href="http://www.martinnormark.com/post/Silverlight-20-provides-better-remote-debugging-experience.aspx">As I wrote here</a>, this is no longer the way to do it as Silverlight 2.0 provides a much better experience.</em></p>
<p>As I wrote recently in <a href="/post/Recommended-listening-NET-Rocks-with-Brad-Abrams.aspx">another blog post</a> about a <a href="http://www.dotnetrocks.com">.NET Rocks</a> <a href="http://www.dotnetrocks.com/default.aspx?showNum=284">interview</a> with <a href="http://blogs.msdn.com/brada/default.aspx">Brad Abrams</a>, I was very impressed with his <a href="http://channel9.msdn.com/Search/SearchResults.aspx?q=remix+boston+keynote&amp;f=&amp;u=MA==">keynote</a> at <a href="http://www.remix07boston.com/Default.aspx">ReMix Boston</a>, where he did the Linux / Vista / Mac debugging. I referred to <a href="http://www.campbellassociates.ca/blog/default.aspx">Richard Campbell</a>'s opinion that he didn't believe it would work. At the end of the post, I wrote that I want to try it for myself, to see if it really works. Brad Abrams posted a comment to my blog post, saying that it should work just fine. Well. This post tells the story.</p>
<h3>Prerequisites</h3>
<ul>
<li>A Windows machine with Visual Studio 2008 and <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=25144C27-6514-4AD4-8BCB-E2E051416E03&amp;displaylang=en">Silverlight Tools Alpha for Visual Studio 2008</a> installed.</li>
<li>A Macintosh with the Silverlight 1.1 Alpha installed.</li>
<li>A network connection on both machines and a way to transfer files between the Vista box and the Mac. (A USB flash drive/stick is fine)</li>
<li>A Silverlight 1.1 Alpha project linked to a website, ready to run.</li>
<li>The website has to be remotely accessible. (Otherwise you can copy the website to the Mac as static HTML files, and run it locally from there.)</li>
</ul>
<h3>Debugging environment</h3>
<p>This is the environment I will use for the debugging. For starters, I want to concentrate on the Vista / Mac debugging, so I won't set up a Linux box with Apache and serve the Silverlight app on a PHP page. But there really should be no problem to it. You can even copy a static HTML page with the XAML page, and the assemblies to the Mac, and run the Silverlight app locally, and attach the Visual Studio debugger to the Safari process on the Mac. Let's save the Linux box for another time.</p>
<p><strong>The mac: </strong>Basically just a Macbook with default configurations, and no special software.</p>
<p><strong>The Vista box:</strong> This is my development box. Windows Vista with Visual Studio 2008, IIS 7 and an ASP.NET website set up at localhost.</p>
<p>Before we get started, locate your Visual Studio 2008 folder on the Vista box (usually: C:\Program Files\Microsoft Visual Studio 9.0), and find the Silverlight folder. This folder contains the necessary files to do the initial set-up. You'll also find a guide to set-up and start debugging, but I've found a few mistakes in there, and you can find yourself confused.</p>
<h3>Setting up the Mac for Silverlight debugging</h3>
<p>Remote debugging is not as easy as pointing Visual Studio to a remote computer, and selecting a process to debug. You have to authenticate against the remote machine. This is done via an SSL encrypted TCP channel between the debugger (The Vista box) and the target machine (The Mac). You will need to set-up the TCP port along with a private/public key pair. This is done in 6 easy steps:</p>
<ol>
<li>Copy the contents of the C:\Program Files\Microsoft Visual Studio 9.0\Silverlight\MacIntel folder to a destination on the Mac of your choosing.</li>
<li>Start up a Terminal on the Mac, and execute the 'configcoreclrdebug' using an absolute filepath. e.g.: /MacIntel/configcoreclrdebug.</li>
<li>First, your private/public key pair will be generated, and then you have to specify a TCP port in the range of 49152 - 65535. Just pick a number.</li>
<li>Then you need to enter a password, and confirm it. Choose a password of at least 8 characters.</li>
<li>A hidden directory is created in your Users folder, located here: /Users/username/.coreclrdbg - copy the "ConfigureWindowsCoreCLRDebugging.exe" file to the Vista box, in a destination of your choosing.</li>
<li>Execute the 'core_clr_proxy' file on the Mac from the Terminal, using an absolute filepath like this: /MacIntel/coreclr_dbg_proxy</li>
</ol>
<p><a href="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_4.png"><img style="border-width: 0px;" src="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_thumb_1.png" border="0" alt="image" width="238" height="244" /></a> <a href="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_6.png"><img style="border-width: 0px;" src="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_thumb_2.png" border="0" alt="image" width="237" height="244" /></a></p>
<p>That was all the set-up needed on the Mac for now. Next up is setting up the Vista box.</p>
<h3>Setting up the Vista machine for Silverlight debugging</h3>
<p>This is the easy part.</p>
<ol>
<li>From a command prompt, run the "ConfigureWindowsCoreCLRDebugging.exe" which you just copied from the Mac.</li>
<li>Enter the password you created on the Mac in step 4, and hit Enter.</li>
</ol>
<h3>Starting the debugger</h3>
<p>Now to the exciting part. Will it work, or not?</p>
<ol>
<li>Launch Safari on the Mac, and point the address to the URL of your Silverlight application you wish to debug.</li>
<li>Launch Visual Studio 2008 on the Vista box, and open the Silverlight project that you wish to debug.</li>
<li>Open up a source file, and set a breakpoint.</li>
<li>From the Debug menu, click Attach to Process. (Or hit Ctrl + Alt + P)</li>
<li>From the Transport drop down menu, select 'CoreCLR Remote Cross-platform Debugging'.</li>
<li>Enter the IP address or hostname of the Mac in the Qualifier box bellow and hit Enter.</li>
<li>Now you should see a list of processes running on the Mac. Anyone that has CoreCLR Remote in the Type column can be attached.</li>
<li>Select the Safari process and hit Attach.</li>
<li>There you go. You've just attached the Safari process on the Mac to the Visual Studio debugger.</li>
</ol>
<p><a href="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_8.png"><img style="border-width: 0px;" src="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_thumb_3.png" border="0" alt="image" width="244" height="170" /></a> <a href="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_10.png"><img style="border-width: 0px;" src="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_thumb_4.png" border="0" alt="image" width="198" height="244" /></a> <a href="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_12.png"><img style="border-width: 0px;" src="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_thumb_5.png" border="0" alt="image" width="244" height="225" /></a></p>
<p>Now. Perform whatever action on the Mac that makes you hit the breakpoint you set before, and take a moment to enjoy real-time cross-platform remote debugging.</p>
<p>Screenshots of the Mac showing the webpage with the Silverlight app:</p>
<p><a href="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_14.png"><img style="border-width: 0px;" src="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_thumb_6.png" border="0" alt="image" width="244" height="213" /></a> <a href="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_16.png"><img style="border-width: 0px;" src="/image.axd?picture=WindowsLiveWriter/WindowsVistaMacdebuggingaSilverlightappu_13764/image_thumb_7.png" border="0" alt="image" width="244" height="213" /></a></p>
<p>The second picture above, has the SetDefaultView() Button highlighted as if I was holding down the mouse bottom. This is because the screenshot is taken when I hit the breakpoint you can see on the third picture of Visual Studio further above.</p>
<p>One thing I noticed while using the Silverlight charts from the Mac, was the speed. When I paste the serialized string in to the textbox and click LoadData() - the Silverlight loads the string and deserializes it to some custom classes I made. On Vista it takes less than a second. On the Mac it takes about two seconds or maybe a bit more. And it is not because of network latency. Silverlight runs in the browser, which means the app is downloaded to the Mac, and when I click the buttons, all the logic handling events and doing stuff runs locally. So Silverlight is lot slower on the Mac than on Windows. Maybe this will get better when Silverlight 1.1 is officially released.</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9e3ef652-e89b-4a5d-9604-0cb2df43c0a6" class="wlWriterSmartContent" style="margin: 0px; display: inline; padding: 0px;">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Silverlight">Silverlight</a>, <a rel="tag" href="http://technorati.com/tags/Debugging">Debugging</a>, <a rel="tag" href="http://technorati.com/tags/Web%20development">Web development</a></div>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.martinnormark.com%2fpost%2fWindows-Vista--Mac-debugging-a-Silverlight-app-using-Visual-Studio-2008.aspx"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.martinnormark.com%2fpost%2fWindows-Vista--Mac-debugging-a-Silverlight-app-using-Visual-Studio-2008.aspx" border="0" alt="kick it on DotNetKicks.com" width="82" height="18" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/windows-vista-mac-debugging-a-silverlight-app-using-visual-studio-2008/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Recommended listening: .NET Rocks with Brad Abrams</title>
		<link>http://martinnormark.com/recommended-listening-net-rocks-with-brad-abrams?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://martinnormark.com/recommended-listening-net-rocks-with-brad-abrams#comments</comments>
		<pubDate>Thu, 25 Oct 2007 20:54:00 +0000</pubDate>
		<dc:creator>Martin Normark</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">/post/Recommended-listening-NET-Rocks-with-Brad-Abrams.aspx</guid>
		<description><![CDATA[If you haven&#39;t heard .NET Rocks before, now is a good time to do it. In their last show, they interviewed Brad Abrams during Remix Boston where he did a keynote. So who is Brad Abrams. Quote from his own &#8230; <p><a class="btn small" href="http://martinnormark.com/recommended-listening-net-rocks-with-brad-abrams">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>
If you haven&#39;t heard <a href="http://www.dotnetrocks.com/">.NET Rocks</a> before, now is a good time to do it. In <a href="http://www.dotnetrocks.com/default.aspx?showNum=284">their last show</a>, they interviewed <a href="http://blogs.msdn.com/brada/default.aspx">Brad Abrams</a> during <a href="http://www.remix07boston.com/Default.aspx">Remix Boston</a> where he did a <a href="http://channel9.msdn.com/Search/SearchResults.aspx?q=remix+boston+keynote&amp;f=&amp;u=MA==">keynote</a>. So who is Brad Abrams.
</p>
<p>
Quote from his own blog:
</p>
<blockquote>
<p>
	<em>Brad Abrams was a founding member of both the Common Language Runtime, and .NET Framework teams at Microsoft Corporation where he is currently the Group Program Manager for the UI Framework and Services team which is responsible for delivering the developer platform that spans both clients and web based applications as well as the common services that are available to all applications. Specific technologies owned by this team include ASP.NET and ASP.NET AJAX, parts of Silverlight, and Windows Forms.</em>
	</p>
</blockquote>
<p>
In the interview, they talk a lot about <a href="http://silverlight.net/Default.aspx">Silverlight</a>, what they are trying to do and how open the technology actually is. And they talk a lot about that openness Microsoft has recently approached, and how the Silverlight technology could be adapted by a developer of any of the three major platforms. (Windows, Mac &amp; Linux). I really like that approach, and the result is clear. Already - even though Silverlight just hit the 1.0 RTM recently, there&#39;s a huge amount of applications running live from notable companies.
</p>
<p>
They also talk a lot about <a href="http://channel9.msdn.com/Search/SearchResults.aspx?q=remix+boston+keynote&amp;f=&amp;u=MA==">Brad Abrams&#39; keynote at Remix Boston</a>, where he did a demo on debugging a Silverlight 1.1 app.
</p>
<p>
And he didn&#39;t do it the easy way! He had a Linux box with a small PHP page, hosting the Silverlight 1.1 app. That worked great. The he fired up a Mac, and hit that page from Safari. And to achieve the debugging experience of Visual Studio, he attached the VS debugger to the Safari process on the Mac, set a breakpoint in the code, and refreshed the page on the Mac, to hit the breakpoint. And there you go. A Mac hitting a breakpoint on a Vista box, and the website being hosted on a Linux box - how cool is that?
</p>
<p>
During the show <a href="http://www.campbellassociates.ca/blog/default.aspx">Richard Campbell</a> said that he didn&#39;t believe it would work. I don&#39;t know - but I want to try the same thing, and se if it really works.
</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:ad948ecf-855e-4749-bf03-0cf4c6162b08" class="wlWriterSmartContent" style="margin: 0px; display: inline; padding: 0px">
Technorati Tags: <a rel="tag" href="http://technorati.com/tags/.NET">.NET</a>, <a rel="tag" href="http://technorati.com/tags/Silverlight">Silverlight</a>, <a rel="tag" href="http://technorati.com/tags/Web%20development">Web development</a>
</div>
<p><!-- ckey="30F6F7A1" --></p>
]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/recommended-listening-net-rocks-with-brad-abrams/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Silverlight 1.0 officially released</title>
		<link>http://martinnormark.com/silverlight-1-0-officially-released?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://martinnormark.com/silverlight-1-0-officially-released#comments</comments>
		<pubDate>Wed, 05 Sep 2007 05:55:00 +0000</pubDate>
		<dc:creator>Martin Normark</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">/post/Silverlight-10-officially-released.aspx</guid>
		<description><![CDATA[This morning, I just read over at Scott Hanselmans blog, that Silverlight 1.0 was released&#160;and it support Linux. So that means Silverlight support all major platforms now, and it is out in the open so your apps can get going. &#8230; <p><a class="btn small" href="http://martinnormark.com/silverlight-1-0-officially-released">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.martinnormark.com/image.axd?picture=WindowsLiveWriter/Silverlight1.0officiallyreleased_72E9/slpenguin-thumb.png" atomicselection="true"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 35px 0px 0px; border-right-width: 0px" alt="slpenguin-thumb" src="http://www.martinnormark.com/image.axd?picture=WindowsLiveWriter/Silverlight1.0officiallyreleased_72E9/slpenguin-thumb_thumb.png" align="left" border="0"></a> This morning, I just read over at <a href="http://www.hanselman.com/blog">Scott Hanselmans blog</a>, that <a href="http://www.hanselman.com/blog/Silverlight10IsOutAndItSupportsLinux.aspx">Silverlight 1.0 was released</a>&nbsp;and it support Linux. So that means Silverlight support all major platforms now, and it is out in the open so your apps can get going. To get some inspiration, you can have a look at these Silverlight apps that Scott posted on his blog: (posted from <a href="http://weblogs.asp.net/scottgu/default.aspx">ScottGu's blog</a>) </p>
<p>Quote <a href="http://www.hanselman.com/blog">Scott Hanselman</a></p>
<ul>
<li>
<p><a href="http://advertboy.wordpress.com/project-silverlight-11/"><em>Recreating ITunes in Silverlight</em></a><em>: Jose Fajardo has an absolutely fantastic blog with a ton of Silverlight content on it.&nbsp; One of the projects he has been working on has been recreating Apple's ITunes Media Player using Silverlight.&nbsp; Check out his </em><a href="http://advertboy.wordpress.com/project-silverlight-11/"><em>multi-part blog series</em></a><em> that discusses step-by-step how he built it.&nbsp; Absolutely brilliant. </em></p>
</li>
</ul>
<ul>
<li>
<p><a href="http://blogs.msdn.com/delay/archive/2007/08/21/time-for-a-little-fun-and-games-silverlight-helps-play-sudoku.aspx"><em>Sudoku for Silverlight</em></a><em>: David Anson has built a cool online sample using Silverlight that helps you play the popular Sudoku game.&nbsp; Useful for both Sudoku addicts and&nbsp;developers wanting to learn Silverlight.&nbsp;&nbsp; </em></p>
</li>
</ul>
<ul>
<li>
<p><a href="http://timheuer.com/blog/archive/2007/08/29/embedding-fonts-with-silverlight-and-user-controls-rss-json.aspx"><em>Font Embedding and RSS data in Silverlight</em></a><em>: Tim Heuer has a cool blog post that shows how you can create your own font-type and embed it within your Silverlight 1.0 application.&nbsp; He then has his application retrieve dynamic content from an RSS feed and use the custom font to display it.&nbsp; You can run the finished application online </em><a href="http://timheuer.com/silverlight/rssfont/"><em>here</em></a><em>&nbsp;(all of the text here is dynamic - not a screen-shot). </em></p>
</li>
</ul>
<ul>
<li>
<p><a href="http://community.rhpconsulting.net/blogs/rhpnetblog/archive/2007/08/09/24.aspx"><em>Silverlight Drag and Drop JavaScript Framework</em></a><em>: Roberto Hernandez-Pou has a nice article and sample that describes how to implement a drag/drop mechanism for Silverlight 1.0 (using JavaScript).&nbsp; This article is in both Spanish and English - scroll down if you are looking for the English version. </em></p>
</li>
</ul>
<ul>
<li>
<p><a href="http://blogs.remobjects.com/blogs/mh/?p=163"><em>Pascal Support for Silverlight</em></a><em>: RemObjects Software now has a project template for VS 2008 that enables you to write Silverlight 1.1 .NET&nbsp;applications using Pascal.&nbsp; It is kinda wild to see a screenshot of FireFox on the Mac, running a Silverlight application, written with a Pascal code-behind file built with VS 2008.</em> </p>
</li>
</ul>
<p>&nbsp;Also, have a look at the <a href="http://silverlight.net">official Silverlight community website</a>, where you'll frind <a href="http://silverlight.net/quickstarts/">quickstarts</a>, <a href="http://silverlight.net/forums/Default.aspx">forums</a> and recent blogposts from leading Silverlight developers and Microsoft people. </p>
<div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:ce9a81ee-9a4c-4a8d-879a-8a4fb6712187" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Silverlight" rel="tag">Silverlight</a></div>
]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/silverlight-1-0-officially-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Web services and Silverlight 1.1 C# gotchas</title>
		<link>http://martinnormark.com/web-services-and-silverlight-1-1-c-gotchas?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://martinnormark.com/web-services-and-silverlight-1-1-c-gotchas#comments</comments>
		<pubDate>Tue, 04 Sep 2007 15:51:00 +0000</pubDate>
		<dc:creator>Martin Normark</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">/post/Web-services-and-Silverlight-11-C-gotchas.aspx</guid>
		<description><![CDATA[As anyone must know by now, Silverlight is Microsoft&#39;s cross-browser, cross-platform RIA (Rich Internet Application)&#160;technology - like Adobe&#39;s Flash. With Silverlight, they say the sky is the limit, and it&#39;s only up to yourself what to invent. Silverlight offers you &#8230; <p><a class="btn small" href="http://martinnormark.com/web-services-and-silverlight-1-1-c-gotchas">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>
As anyone must know by now, Silverlight is Microsoft&#39;s cross-browser, cross-platform RIA (Rich Internet Application)&nbsp;technology - like Adobe&#39;s Flash. With Silverlight, they say the sky is the limit, and it&#39;s only up to yourself what to invent. Silverlight offers you a big chunck of the .NET CLR in the browser, when using Silverlight 1.1 Alpha (Refresh). As always, there are do&#39;s and don&#39;ts when you work with new technology and in this not-known-yet-part series, I&#39;m going to recap my experience using Silverlight 1.1 Alpha and later Silverlight 1.1 Alpha Refresh to develop some sophisticated charting components.
</p>
<h2>Before you begin - general info</h2>
<p>
For the current release of Silverlight (Silverlight 1.1 Alpha Refresh) you don&#39;t have the System.Data namespace (that means no DataSets nor DataTables). Also the System.Xml namespace is very small, you don&#39;t get the XmlDocument which would have been useful. I haven&#39;t heard anything reliable about whether or not those namespaces and classes will make it into the final release of Silverlight, but it doesn&#39;t seem like it.
</p>
<p>
Maybe 3rd party components will come to help here, but that&#39;s a drawback because then the users have to install something new on their machines to be able to use your app.
</p>
<h2>Mark your webservice as a ScriptService</h2>
<p>
If you&#39;re going to use any kind of data in your Silverlight apps, and you probably are, then you have to use a webservice. Calling a webservice from Silverlight is a bit different from calling a webservice from another ASP.NET page.
</p>
<p>
First of all, you have to mark your webservice as Scriptable. The Scriptable attribute excists in the System.Web.Script.Services namespace, and is part of the ASP.NET AJAX framework (also included in the .NET Framework 3.5). If you are developing on ASP.NET 2.0, you have to make sure you have ASP.NET AJAX installed on the server, and reference the correct assemblies in your ASP.NET 2.0 application.
</p>
<p>
This is how your class definition will look like:
</p>
<pre class="csharpcode">
[WebService(Namespace = <span class="str"><a href="http://tempuri.org/">http://tempuri.org/</a></span>)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
<span class="kwrd">public</span> <span class="kwrd">class</span> SilverchartDataService : System.Web.Services.WebService{
</pre>
<pre class="csharpcode">
}
</pre>
<p>
<br />
Now your webservice can be called from Silverlight - and also JavaScript / AJAX.
</p>
<h2>Don&#39;t call a webservice on another domain</h2>
<p>
The security model of Silverlight, and also other client-side technologies, deny calling a webservice on another domain. That is also called cross-domain webservice calls, and if you do, you will get this exception when #debugging your Silverlight app using Visual Studio 2008:</p>
<p><a href="/image.axd?picture=WindowsLiveWriter/Silverlight1.1Crecipesandgotchaspart1_102EC/image.png"><img style="border-width: 0px" src="/image.axd?picture=WindowsLiveWriter/Silverlight1.1Crecipesandgotchaspart1_102EC/image_thumb.png" border="0" alt="image" width="541" height="241" /></a>
</p>
<p>
I&#39;ve seen ways to get around this problem, but it is beyond the purpose of this blog post. If you need info on this topic, try this: <a href="http://dotnetslackers.com/columns/ajax/MashitUpwithASPNETAJAX.aspx">Using a proxy to access remote APIs</a>&nbsp;(The article is for AJAX - should work for Silverlight)
</p>
<h2>JSON Serialization compatibillity with .NET</h2>
<p>
Whenever you use a webservice, all the objects transfered gets serialized. (Remember to mark your own classes as Serializable if you want to use them in your webservice.) And Silverlight uses the JSON Serialization &#39;engine&#39;. This can result in some nasty errors, yet difficult to debug. I&#39;ve found out, that some .NET classes cannot be used - these include:
</p>
<ul>
<li>decimal </li>
<li>enum (So don&#39;t use enum&#39;s with Silverlight - at least not until it is supported)</li>
</ul>
<p>
And there are probably more than those two...
</p>
<div id="0767317B-992E-4b12-91E0-4F059A8CECA8:94b31523-f28e-4a30-bc4d-93c3f9a66fce" class="wlWriterSmartContent" style="display: inline; margin: 0px; padding: 0px">
Technorati Tags: <a rel="tag" href="http://technorati.com/tags/ASP.NET">ASP.NET</a>, <a rel="tag" href="http://technorati.com/tags/C#">C#</a>, <a rel="tag" href="http://technorati.com/tags/Silverlight">Silverlight</a>, <a rel="tag" href="http://technorati.com/tags/Web%20services">Web services</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/web-services-and-silverlight-1-1-c-gotchas/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>

