Sunday, September 7, 2008

Silverlight hidden detail: can´t write to UI while doing asynchronous calls

Let's get some data from a RSS feed. No big deal, because there's a pretty example in the silverlight site quickstarts.

However, I wanted to do my concept prove in VB.Net, and take the data from a List in Sharepoint.

As usual, Sharepoint let's you create your list, then you can add some items, and because I don´t know the trick to get directly the RSS reference, I publish the list contents in a Content query web part, activating the feed.

Ah, of course, you must add a Clientpolicyaccess.xml file on tje root of the site to get access.

But when I translate the code for my new Silverlight app, and ran it: surprise!!!! Nothing happends. So I check the IDE output and there's a message like this:

A first chance exception of type 'System.UnauthorizedAccessException' occurred in System.Windows.dll

So I added a variable to get the content from the feed, and a button to launch the textbox refresh. The content reading was fine; and when the button was clicked the content was assigned fine, so where's the deal?

Thanks to the post from Mark Monster, I discover the trick: use

Dispatcher.BeginInvoque(Adressof YourUIUpdateOps)

inside the thread; you need to create a method called YourUIUpdateOps to define the UI ops that you need.

And all this is needed because you can't perform UI ops in threads used for async communications (beware of WS).

24 hours to get the answer. Such is life.

Tuesday, September 2, 2008

Virtualization: cheaper development & deployment environments

So, you don´t have a server at home or can´t stay at your client's cold room, and you need to do some tests in a sort of infrastructure. Well, then the only chance to have access to these resources is by using a virtualization software, that allows a single host computer to create and run one or more virtual environments.

The options:

VMware Home
Virtual PC Home
VirtualBox Home
Parallels

If you are using Virtual PC, this links are usefull:
How to Create a MOSS 2007 VPC Image: The Whole 9 Yards
Why I Love My Virtual PCs


If you are using VirtualBox:
Create a Virtual Machine with VirtualBox


To know more about virtualization:
What is virtualization?
Virtualization (wiki)
Virtualization - A Quick Tutorial
Virtualization 101
The Hows and Whys of Server Virtualization

Silverlight. Month 1.

It's been an interesting experience this days with Silverlight. The reasons are many:

- A multiplatform multi-browser technology with MS support.
- It was used to transmit the Olympics over the Internet.
- The community is embracing the new toy, makint examples, articles & video tutorials.

Seems like Flex/Flash are not alone anymore in the Web.

Next steps to climb the lerning curve:

+ Integration with Sharepoint 2007.
+ Produce a showcase to explore the capabilities of the platform and tools.
+ Wait till november to get the release of versión 2.

Time is coming for a Saas project!