tags:

views:

28

answers:

1

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?

+1  A: 

Can you not use this which will give you the location the silverlight control was loaded from and thus determine if you need to load from the internet or localhost? This assumes obviously you are hosting the control in different places for development and for live deployment.

tyranid