CSharp/C# >> ApplicationDeployment and HttoContext

by QXR1bCBSYW5l » Sun, 07 Sep 2008 16:17:21 GMT

I am using ClickOnce to run my windows application from web page.
Know i want to get querystring value in my windows application in have done
code like this :
public NameValueCollection GetQueryStringParameters()
{
NameValueCollection nameValueTable = new NameValueCollection();
if (ApplicationDeployment.IsNetworkDeployed)
{
string queryString =
ApplicationDeployment.CurrentDeployment.ActivationUri.Query;
nameValueTable = HttpUtility.ParseQueryString(queryString);


}
return (nameValueTable);
}

I am getting error :
The name 'ApplicationDeployment' does not exist in the current context.
The name 'HttpUtility' does not exist in the current context.

CSharp/C# >> ApplicationDeployment and HttoContext

by Marc Gravell » Sun, 07 Sep 2008 16:27:17 GMT


HttpUtility requires a reference to System.Web.dll (although it might
be more convenient to just split it yourself, especially if you are
targeting the lightweight Client Profile)

ApplicationDeployment requires a reference to System.Deployment.dll

Marc

CSharp/C# >> ApplicationDeployment and HttoContext

by QXR1bCBSYW5l » Sun, 07 Sep 2008 17:39:17 GMT



Similar Threads

1. ClickOnce, ApplicationDeployment & AppDomains

Hi,

I'm writing a client app, the app creates a new AppDomain on startup so that 
when we switch logins we just create new AppDomains.

I'm trying to publish it as a ClickOnce application. It's all deployed and 
running (kind of) - but I need to test the 
ApplicationDeployment.IsNetworkDeployed property.

If I attempt to read this property in the startup code - it's fine
If I attempt to read this property in the new app domain - it fails. Look 
like the ApplicationDeployment information has not been copied over into the 
new app domain.

So my question is...How do I make the ApplicationDeployment information 
available in the new App Domain.

I create the new App Domain like so:

AppDomainSetup domainSetup = new AppDomainSetup();
domainSetup.LoaderOptimization = LoaderOptimization.MultiDomain;
domainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
domainSetup.ApplicationTrust = AppDomain.CurrentDomain.ApplicationTrust;

Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
			
AppDomain ad = AppDomain.CreateDomain("myclient", evidence, domainSetup);

Cheers,
Huw

2. ApplicationDeployment.CurrentDeployment.CheckForUpdate() has serious memory leak problem - .Net Framework

3. ApplicationDeployment.DownloadFile() Questions

I created a clickonce deployed application with an optional config.xml data
file which is downloaded when the app starts using
ApplicationDeployment.DownloadFile("ConfigGroup") call.  The file comes down
to the client (from a file share) fine, but my question is: Where is this
file comming from?

The reason I ask is I've run into some wierd behavior.  I was hoping I could
use this to update config info without issuing a new release, so I tried
changing the config.xml on the server and deleted the current version on the
client.  A config.xml file appeared on the client, but it wasn't the newer
version, it was the original version.  Next I deleted the file from both the
server and client locations, but the config.xml file appeared anyway?  I
would have thought it wouldn't appear since it doesn't exist on the server.

Any idea what's going on?  TIA
JL

PS I have more examples, but their even stranger...


4. ApplicationDeployment Class - Microsoft .NET Framework