473,471 Members | 4,629 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ClickOnce apps unable to update?

I've been playing around with ClickOnce today, and it's all good stuff.
Except, that if I change my application to NOT be full trust (which seems to
make very little difference to the user prompt, which scares me!) but to be
installed on the start menu, it seems I don't have permission to call
CheckForUpdate()!

I understand that if I'm not a full trust app, I can't read the filesystem
etc., but not being able to update myself seems a bit flawed, given that's
what ClickOnce is all about - deployment??

Below is a stack trace, but to reproduce...

- Create a new WinForms app
- Add a button that calls
ApplicationDeployment.CurrentDeployment.CheckForUp date()
- Set it to be installed in the start menu
- Disable any auto-updating options
- Change it to be a partial trust app, installed from "Internet" with the
defaults.
- Set your publish location etc., and publish it.

Click the button, and viola, you'll get the below.

My project's looking like it needs to be full trust anyway (I need to
connect to foreign servers), but it'd be nice to know if it wasn't, I could
still programatically update it :-(
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Security.SecurityException: Request failed.
at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at
System.Deployment.Application.ApplicationDeploymen t.CheckForUpdateAsync()
at ClickOnceTest.Form1.UpdateApplication()
at ClickOnceTest.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.PermissionSet
The Zone of the assembly that failed was:
MyComputer
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ClickOnceTest
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Documents%20and%20Settings/Danny%20Tuppeny/Local%20Settings/Apps/2.0/RGET4OHN.Q1M/ZERZOTTB.PZ4/clic..tion_ecff6c31000b4e14_0001.0000_87b11c99a9e0 5835/ClickOnceTest.EXE
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Deployment
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Nov 17 '05 #1
5 5222
Hi,

Using the ClickOnce APIs requires full-trust.
Thanks,
Sayed Y. Hashimi
http://www.sayedhashimi.com
Shameless Book Plug: Service-Oriented Smart Clients with .NET 2.0
http://www.amazon.com/exec/obidos/tg...3/qid=11263614...

Nov 17 '05 #2
<ha**********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Using the ClickOnce APIs requires full-trust.


That's what I figured - I don't understand why though! By default, apps can
connect to the site they were downloaded from, and that's pretty much all
the ClickOnce CheckForUpdate does, right?

So.....

This is complete madness. It's going to be ActiveX all over again.
Application developers will say "It has to be full trust, so we can deliver
updates in a sane fashion, when you want" (people don't want their app
downloading updates while they're on expensive mobile connections), so users
will get used to saying Yes to full-trust apps, and the whole CAS thing is
useless, and our users computers all fill up with garbage. Excellent :-(
Nov 17 '05 #3
"Danny Tuppeny" <gr****@dannytuppeny.commmmmm> wrote in message
news:43***********************@ptn-nntp-reader04.plus.net...
<ha**********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Using the ClickOnce APIs requires full-trust.


That's what I figured - I don't understand why though! By default, apps
can connect to the site they were downloaded from, and that's pretty much
all the ClickOnce CheckForUpdate does, right?

<snip>

From MSDN:

Update, UpdateAsync, CheckForUpdate and CheckForUpdateAsync require Full
Trust
Calling the Update, UpdateAsync, CheckForUpdate, and CheckForUpdateAsync
methods now requires Full Trust. This is a change since Beta 1.

But no reasons! :-(
Nov 17 '05 #4
Hi Danny,

I don't think it is going to be that bad. Realize that you need
full-trust if your application is going to use the ClickOnce APIs to do
updates. That doesn't mean that an application has to have full trust
to be auto-updatable. The ClickOnce runtime is the piece that manages
auto-updates for your application and the ClickOnce runtime has
full-trust. This means that partially trusted applications are also
auto-updatable. They cannot however use the ClickOnce APIs to do
on-demand updates--because the code that executes the ClickOnce APIs
has to have full-trust privilages.

Thanks,

Sayed Y. Hashimi
http://www.sayedhashimi.com
Shameless Book Plug: Service-Oriented Smart Clients with .NET 2.0
http://www.amazon.com/exec/obidos/tg...3/qid=11263614...

Nov 17 '05 #5
<ha**********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I don't think it is going to be that bad. Realize that you need
full-trust if your application is going to use the ClickOnce APIs to do
updates. That doesn't mean that an application has to have full trust
to be auto-updatable. The ClickOnce runtime is the piece that manages
auto-updates for your application and the ClickOnce runtime has
full-trust. This means that partially trusted applications are also
auto-updatable. They cannot however use the ClickOnce APIs to do
on-demand updates--because the code that executes the ClickOnce APIs
has to have full-trust privilages.


I understand this. But for a large application, the auto-updates isn't
flexible enough. ClickOnce supports non-mandatory filegroups, which can be
downloaded on demand - with the APIs. Without the APIs, there's also no room
for custom logic - eg. I want to deliver an update to my priority customers
first, and others later. I can't implement that without using the APIs in my
own code (unless I faff about having multiple deployment locations, which is
silly).

I'm not saying ClickOnce is useless, but it's certainly nowhere near as
flexible as it should be, without full trust :-(
Nov 17 '05 #6

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

Similar topics

0
by: Pavan | last post by:
I have my .NET code published in two servers http://server1/<ApplicationName>/Publish.htm and http://server2/<ApplicationName>/Publish.htm, and if i open IE on the client machine and type the link...
1
by: cathywigzell | last post by:
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...
2
by: seanbrasher | last post by:
I've been asked to create an app that deploys in the way ClickOnce does, and updates itself silently, with no user interaction at all. Is this possible using ClickOnce or does the user always get...
0
by: Etienne | last post by:
Hi, I am settings up my application to work with ClickOnce deployment. However, after instlling installing an update, the database doesn't get copied. I tried everything I could think of. It is...
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: Ryan Liu | last post by:
hi, I like the Publish function comes with VS2008. But 3 questions remain: how to make update path to be flexiable? Because I will give those updates to my cutomers, and different cutomer will...
3
by: =?Utf-8?B?RXJpYw==?= | last post by:
I just deployed a ClickOnce application to a large amount of users. Several are unable to run the application. There is a shortcut that is a url to a ..application file. The ClickOnce app is set...
7
by: LukasMalik | last post by:
Hi all, my application (C# WinForm .NET 3.5) is distributed via ClickOnce deployment. Application should check for updates on our company web. Problem comes when any part of application has...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.