Blog Home  Home RSS 2.0 Atom 1.0 CDF  
The Efficient Coder - Silverlight
There has got to be a better way of communicating with our computers!
 
 Sunday, November 16, 2008

Early on in my career I was mentored on deferring execution.  This was in a language called FORTH and the idea was build your program structure and abstract the details into WORDS to be filled in later.  Repeat until complete.  This simple process still holds true today in OO languages like C# where I do most of my work.

Now back to why I like Silverlight/WPF, as I'm just starting to get beyond the basics, the more I'm starting to see that this is an extremely well thought out architecture.  As I'm developing my functionality I can easily "defer execution" or really in this case, care zero about the style and then go in later and make it pretty.  Or if I'm really lucky find someone that knows what they are doing to give it a polished look.  Although the same can be done with HTML and CSS, this just seems like it's just a bit cleaner and since we are targetting only one type of client (Silverlight or WPF) instead of the different browsers the results are much more repeatable.

The other thing I'm really impressed with is the separation of UI and code behind.  Although time will tell on the actual business value (read ability to maintain and extend) it seems like the ability to create CLR instances in the XAML and then glue everything together with dependency properties, just feels good to do.

Now back to getting some work done with this!

-ec

11/16/2008 1:56:42 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   .NET 3.5 | ASP.NET | Silverlight  |  Trackback
 Monday, November 03, 2008

I've finally found a good excuse to implement something using Silverlight 2.0 within my web product.  After spending about 3-4 hours attempting to get my Silverlight app to talk to a local web service, I found out something that hopefully will save you some time.  First a little about my environment.  I'm using IIS 7.0 on a 64 bit machine.  I have IIS setup with two sites for my Silverlight development, the first hosts my web service, the second hosts the web site containing my Silverlight application.  I have my hosts file setup as follows

127.0.0.1   webservice
127.0.0.1   website

Then in IIS I bind the the web sites to those host names.

After setting up the clientaccesspolicy.xml file in my webservice site to allow Silverlight to access I just couldn't get my Silverlight app to talk to my web service.  I tried this in both IE and Firefox with no luck.  After doing a little testing, I found it worked when I used the development web server (I think this was formally called cassini) it also seemed to work when when I used the host name "localhost".  Next I fired up fiddler and watched the network traffic.  Anytime I used cassini or local host, the clientaccesspolicy.xml was downloaded and the call to the web service succeeded.  If I tried this through my site, no request was made.

After trying a number of things I found I was able to get this working by opening the security settings within Internet Explorer

Tools->Internet Options->Security Tab, then click on Local Intranet and add my two sites.  This seemed to do the trick for both Internet Explorer and Firefox.

Hope this saves you a bit of time

-ec 

11/3/2008 8:50:58 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   ASP.NET | Silverlight  |  Trackback
Copyright © 2009 Kevin D. Wolf. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: