Showing posts with label SilverLight. Show all posts
Showing posts with label SilverLight. Show all posts
Sunday, February 27, 2011
Silverlight 1.1 Alpha Refresh patch to run after expiration date
Once upon a time I won a Silverlight coding competition by writing a simple game in Silverlight 1.1 Alpha Refresh. A few weeks ago a beta tester of my game requested to play with it, once more. Installing the redistributable (thanks god I keep an archive of these because I couldn’t find it on Microsoft’s site) I came up with a message box that said that this version has expired (the alpha version should expire on 1st nov 2007).
Wednesday, June 13, 2007
Silverlight with Visual Studio .NET 2005 and vb.net
I just got back from Budapest's Remix 2007. It was an awesome conference where I got amazed by the new Silverlight 1.1 possibilities. Thus the first thing I did was to try build a simple ‘Hello world’ application using vb.net. First of all, although the guys in Microsoft have Silverlight support in visual studio Orcas, there is no integration (at least as far as I know) with vs 2k5. Looking around on the net, I found a tip given by Scott Louvau to Bryant Likes on how to create a silverlight c# application with vs2k5.
Well, in VS2005 you can create a class library which will build against the Silverlight runtime, but it's a little work.
- Create a Class Library/
- Remove all references from it.
- Right-click on the Project and pick Properties.
- On the Build tab, click Advanced and check 'Do not reference mscorlib.dll'
- Manually add references to mscorlib, agclr, System,System.Core, System.Silverlight, and System.Xml.Core from the Silverlight install folder (\Program Files\Microsoft Silverlight\)
At this point your build outputs should be Silverlight consumable binaries. It looks
like the equivalent command line call to csc.exe (the C# compiler) should include the references to the mentioned binaries and the /nostdlib option but may require others as well.
The above mentioned solution could not be implemented on a VB project because there was no way I could tell the vb compiler to not reference mscorlib.dll as the compiler requires the Microsoft.VisualBasic.dll which refers to system.dll and finally we get a reference to mscorlib.dll. Thus I had to find a workaround for this…
The idea was to trick visual studio and use the silverlight framework instead of the normal .net 2.0. So I created a class library project based on the .NET Compact Framework 2.0 for Windows CE 5.0. Thus I got the compiler looking for the framework in the following path: "C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\"
Since I am not currently developing any windows CE application I simply replaced the contents of that path with the ones from the silverlight framework (located at "C:\Program Files\Microsoft Silverlight\").
So, we have tricked the compiler to not use the regular .net framework. From now on the things are quite straight forward.
- Create a Class Library.
- Remove all references from it.
- Manually add references to mscorlib, agclr, System, System.Core, System.Silverlight, and System.Xml.Core from the Silverlight install folder (\Program Files\Microsoft Silverlight\)
Done. Create your xaml, html and js files and you are ready to experience the silverlight experience through visual studio 2005 and vb.net :)
Bryant Likes offers a c# example of the Hello world application on his blog http://blogs.sqlxml.org/bryantlikes/archive/2007/05/02/silverlight-hello-world-in-c-from-vs-2005.aspx .
Thus I converted the above example in to the following vb.net hello world example:
Subscribe to:
Posts (Atom)