How can I determine in silverlight code where the silverlight instance is running?

Posted by Edward Tanguay on Stack Overflow See other posts from Stack Overflow or by Edward Tanguay
Published on 2010-03-15T04:46:25Z Indexed on 2010/03/15 4:49 UTC
Read the original article Hit count: 436

Filed under:

I have a silverlight app.

When I develop I have it pick up its data from a local URL:

http://localhost/theapp/data/...

however, when it is online, I want it to pick up its data from an online URL:

http://www.tanguay.info/...

Currently I have a variable which I switch before I compile and upload:

bool silverlightAppIsLive = true;

which I use to determine whether or not to get data from the first or second URL above.

Is there a way for me to determine this automatically in code without setting the variable manually?

© Stack Overflow or respective owner

Related posts about Silverlight