473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

ClickOnce reference to web server

I have a small ClickOnce application which communicates with the server
it loaded from. When I created the ClickOnce app, I added a Web
Reference to a .asmx file on the server. The app then uses this
reference to make calls to the server. That all works nicely.

However, at deployment, every server will have a unique name
(obviously). Yet my ClickOnce app will still have its hard-coded web
reference.

How can I change the web reference dynamically? The ClickOnce app must
know the server location (to check for updates) - how can I get hold of
this and then use it to make calls back to the same server? Or, is
there some other way of setting the Web Reference appropriately?

Cathy

Feb 27 '06 #1
1 2009
For getting the ClickOnce location of a non-installed (online-only)
application:
First check that
System.Deployment.Application.ApplicationDeploymen t.IsNetworkDeployed is
true - otherwise you aren't running as ClickOnce and nothing can work; after
this you have access to a range of properties on
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment, most
noteably UpdateLocation.

(for installed apps, I suspect that the update location may well be burned
into the manifest, so it might return the same value on any server; one to
check if you use this)

For changing the web-service end-point, simply update the WebService URL
property; it is a pain to have to do this each time you create an instance,
so I do something like:

public static class WebServices {
public static T Get<T>() where T :
System.Web.Services.Protocols.SoapHttpClientProtoc ol, new() {
T service = new T();
service.Url = "something else dynamic"; //TODO: example only
return service;
}
}

This allows me to call WebServices.Get<SomeService> and apply a host of
standard options each time.

Hope this helps,

Marc
Feb 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: moondaddy | last post by:
I have a .net 2.0 smarclient app and am trying to deploy it to IIS where users can access it from. I created an application folder in IIS where I'm trying to deployee to. 1) When the...
1
by: Daniel Knöpfel | last post by:
Hello Im triying to create an installer using ClickOnce and visual studio 2005. This works fine on my computer, but as soon as i start the created installer on another pc I get the following...
1
by: Mr. Beck | last post by:
I am in the process of creating a C# ClickOnce application that will be deployed in the coming months. I was initially thinking of deploying it through Windows Installation but due to the need of...
1
by: M O J O | last post by:
Hi, I've have searched google, but can't find a solution to my problem. Om my develloper machine, I use one app.config, but when I deploy, I need to deploy another app.config. The reason...
2
by: Alex Bögli | last post by:
Hi I have a rather advanced deployment scenario and wanted to know, if anyone has an idea how to accomplish that with ClickOnce: We are deploying a 3-tier application with a client connecting...
2
by: Daniel | last post by:
Hey guys Ok i have a few probs with clickonce. User must have .net2 , i need them to also have dx and they must use Internet explorer as click once wont work in mozilla, firefox etc From some...
3
by: =?Utf-8?B?Um9nZXIgVHJhbmNoZXo=?= | last post by:
Hello, I would like to know the best way to install an clickonce in .net 3.5 (we use LINQ 8-D) published application on terminal server 2003 Do I have to install it on EVERY user that will use...
3
by: Peter Carlson | last post by:
Our app uses the following chain of urls: 1. yoursite.com/launch.php?room=00000271 - validates the roomid appends an appropriate server variable and encrypts and adds a hash and sends on to #2 ...
3
by: =?Utf-8?B?S2VuIExlbWlldXg=?= | last post by:
My clickonce app fails when the install button on the publish.htm page is clicked. User is prompted with a "Cannot Start Application" dialog. Details provided from the dialog are: PLATFORM...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.