473,734 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ 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
ApplicationDepl oyment.CurrentD eployment.Check ForUpdate()
- 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 .SecurityExcept ion: Request failed.
at System.Security .CodeAccessSecu rityEngine.Chec k(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security .PermissionSet. Demand()
at
System.Deployme nt.Application. ApplicationDepl oyment.CheckFor UpdateAsync()
at ClickOnceTest.F orm1.UpdateAppl ication()
at ClickOnceTest.F orm1.button1_Cl ick(Object sender, EventArgs e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr 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%20Setting s/Apps/2.0/RGET4OHN.Q1M/ZERZOTTB.PZ4/clic..tion_ecff 6c31000b4e14_00 01.0000_87b11c9 9a9e05835/ClickOnceTest.E XE
----------------------------------------
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__b77a5c 561934e089/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__b77a5c 561934e089/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__b03f5f 7f11d50a3a/System.Drawing. dll
----------------------------------------
System.Deployme nt
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployme nt/2.0.0.0__b03f5f 7f11d50a3a/System.Deployme nt.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:

<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</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 5247
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**********@g mail.com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.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****@dannytu ppeny.commmmmm> wrote in message
news:43******** *************** @ptn-nntp-reader04.plus.n et...
<ha**********@g mail.com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.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 CheckForUpdateA sync require Full
Trust
Calling the Update, UpdateAsync, CheckForUpdate, and CheckForUpdateA sync
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**********@g mail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.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
2201
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 (http://server1/<ApplicationName>/Publish.htm) it would install the application in the client machine from server1. 1) Changing the server location on the same client machine (i.e. http://server2/<ApplicationName>/Publish.htm) should override...
1
2035
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 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...
2
7645
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 prompted when a new version is available?
0
1387
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 a SQL Server Express database created in ClickOnce data folder (ApplicationDeployment.CurrentDeployment.DataDirectory). I use User Instances, that is, I connect directly to the database file. So, I install version 0.7.0.0, run it, it creates a...
2
1619
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 earlier posts i hope to have the dx issue sorted with some pre-requisites i am yet to try. But i had an idea and want to know if this is possible.
3
5320
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 it ? If so, all the files will be duplicated for every user ? in wich folder ? If not, where will reside the application on the server ? how to make a shortcut for the main "executable" for all the users pointing to that ?
3
2043
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 use differnt server/shard path. And after install on client machine, where does it copy all files? Because I have a configure file need user to modify it. Each cutomer has hundrends
3
2279
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 up as "available online only". When the user opens the shortcut the browser opens and then immediately closes. A folder structure is created in the C:\Documents and Settings\UserName\Local Settings\Apps\2.0\ folder but no data is copied. The...
7
4245
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 reference to assemblies which are not installed (registered) on curent machine. In solution are some library projects which works with MS Office and therefore has referenced some MS Office libraries. If no MS Office (2000/2003/2007) is installed on...
0
8776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
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.