cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tony_malandain
Level 3

Using Update Service from .Net

Hi,

I've started writing some code to evaluate Update Service.
The interop looks ok, the code compiles, but for some reason it doesn't return any of the updates available where the update manager from the control panel (on Win XP) shows some available.
Here is my code (code is a GUID structure containing the product code)

DWUpdateServiceLib.Agent agent = new AgentClass();
string codeStr = code.ToString("B").ToUpper();
if(agent.IsConnected())
{
Updates updates = agent.EnumUpdates(codeStr);
int count = updates.Count;
foreach(Update u in updates)
{
if (u.Type == updateType)
{
messageList.Add(u);
}
}
}

When I run this code, updates.Count returns 0 where I was expecting 1.
Any idea why?
Thanks,
/Tony.
0 Kudos
(1) Reply
tony_malandain
Level 3

Hi,
me again.

I made a wrong diagnostic of my problem.
The .Net interop works fine.

The problem is with the Update Service Test Utility. I used it to set the machine to receive both active and test updates. The problem is that this works at the user level, ie: only my user account on the computer can see test updates.

How can I set the same behavior at the system level? (ie: I want to use the Update Service from a Web interface that is running with the SYSTEM account for which I cannot run the test utility program).:confused:

Thanks,
/Tony.
0 Kudos