P
Peter Carlson
Not sure if this is the right NG, if not please point me in the right
direction.
We are developing a clickonce installer for our program Here are my
basic questions:
1. How can I really debug this? Simply pressing F5 in VS2005, doesn't
really provide the same environment...for example no Http query string
2. After publishing to the hard drive if I open publish.htm in IE and
then click on run, nothing happens - it's like it never opens the app.
If I use IE and go directly to the .application file it never opens.
Only if I publish to a website, this makes minor debugging a pain as I
have to repost for every little code change,
3. Finally, the last question for now. Our app needs to read the query
string. in vs2005 I have set it as a full trust application. When i
run it it generates this exception:
System.NullReferenceException ... Form1.GetQueryStringParameters()
and then the sQuery variable is empty as shown in the MessageBox. I
have changed publish.htm to be:
directLink = "clickonceinstaller.application?server=foo&test=peter";
Code from form1.cs is:
NameValueCollection aParams;
string sQuery;
private void Form1_Load(object sender, EventArgs e)
{
aParams = GetQueryStringParameters();
MessageBox.Show(sQuery);
if (aParams.Count == 0) { this.Close(); return; }
}
private NameValueCollection GetQueryStringParameters()
{
NameValueCollection nameValueTable = new NameValueCollection();
if (ApplicationDeployment.IsNetworkDeployed)
{
try
{
string queryString =
ApplicationDeployment.CurrentDeployment.ActivationUri.Query;
sQuery = queryString;
nameValueTable =
System.Web.HttpUtility.ParseQueryString(queryString);
}
catch (Exception exception)
{ MessageBox.Show(exception.ToString()); }
}
return (nameValueTable);
}
Thanks to all!
Peter
direction.
We are developing a clickonce installer for our program Here are my
basic questions:
1. How can I really debug this? Simply pressing F5 in VS2005, doesn't
really provide the same environment...for example no Http query string
2. After publishing to the hard drive if I open publish.htm in IE and
then click on run, nothing happens - it's like it never opens the app.
If I use IE and go directly to the .application file it never opens.
Only if I publish to a website, this makes minor debugging a pain as I
have to repost for every little code change,
3. Finally, the last question for now. Our app needs to read the query
string. in vs2005 I have set it as a full trust application. When i
run it it generates this exception:
System.NullReferenceException ... Form1.GetQueryStringParameters()
and then the sQuery variable is empty as shown in the MessageBox. I
have changed publish.htm to be:
directLink = "clickonceinstaller.application?server=foo&test=peter";
Code from form1.cs is:
NameValueCollection aParams;
string sQuery;
private void Form1_Load(object sender, EventArgs e)
{
aParams = GetQueryStringParameters();
MessageBox.Show(sQuery);
if (aParams.Count == 0) { this.Close(); return; }
}
private NameValueCollection GetQueryStringParameters()
{
NameValueCollection nameValueTable = new NameValueCollection();
if (ApplicationDeployment.IsNetworkDeployed)
{
try
{
string queryString =
ApplicationDeployment.CurrentDeployment.ActivationUri.Query;
sQuery = queryString;
nameValueTable =
System.Web.HttpUtility.ParseQueryString(queryString);
}
catch (Exception exception)
{ MessageBox.Show(exception.ToString()); }
}
return (nameValueTable);
}
Thanks to all!
Peter