Specified cast is not valid. at WUApiLib.UpdateServiceManagerClass.AddScanPackageService

Hello

[OS version: Windows XP Professional 5.1.2600 Build: xpsp.sp3.gdr.101209 - 1647 Service Pack 3]

I'm trying to Scan for hotfixes available in offline mode (with wsusscan.cab) on Windows XP using c:\windows\system32\wuapi.dll in c#. Here is the code
UpdateSessionClass updateSession = new UpdateSessionClass();
IUpdateServiceManager updateServiceManager = updateSession.CreateUpdateServiceManager ();
IUpdateService updateService is updateservmanager. AddScanPackageService ("Sync currently out-of-Service", CabFilepath, 0);
IUpdateSearcher updateSearcher = updateSession.CreateUpdateSearcher ();
updateSearcher.ServerSelection = ServerSelection.ssOthers;
updateSearcher.ServiceID = updateService.ServiceID;
ISearchResult searchResult = updateSearcher.Search ("IsInstalled = 0 or IsInstalled = 1");
This code works fine on other versions of Windows XP and Windows 7. It is with this particular build xpsp.sp3.gdr.101209 - 1647
All the DLLs on this machine are old. They have not been updated. So he is still using c:\windows\system32\wuapi.dll since 2008.
At first, when I ran this code, I got an Exception
Impossible object cast COM of type 'WUApiLib.UpdateSessionClass' to interface type 'WUApiLib.IUpdateSession3 '. This operation failed because the QueryInterface call on the COM component for the interface with IID '{918EFD1E-B5D8-4C90-8540-AEB9BDC56F9D}' failed due to the following error: no such interface supported (Exception from HRESULT: 0 x 80004002 (E_NOINTERFACE)).    at WUApiLib.UpdateSessionClass.CreateUpdateServiceManager)

To resolve this problem, I recorded the existing c:\windows\system32\wuapi.dll located in the System32 folder, then replaced this dll with a newer version of c:\windows\system32\wuapi.dll and recorded again. This time I was able to create "UpdateServiceManager" but threw an exception to the AddScanPackageService(). The Exception is
Specified cast is not valid. at WUApiLib.UpdateServiceManagerClass.AddScanPackageService (String scanFileLocation, String serviceName, Int32 flags)
I'm not able to get more information about this exception. Also, I have no idea why the cast is not valid.
I need to replace no matter what other dll like I did with c:\windows\system32\wuapi.dll? What I'm missing here? Any help would be greatly appreciated.
Thank you.
[note: I can't update my OS.] I have to work with this version and compilation]

Hi SivaKishan,

The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the link below.

http://social.msdn.Microsoft.com/forums/en-us/categories

Hope this information helps.

Tags: Windows

Similar Questions

  • Cannot delete the file and the error is "the specified file is not valid or too long." Specify a different file name.

    Hello

    I have filenames with weird values inside (created by Application software).
    Here is an example:
    GIBtmpphoto0_11:27:16.145.png

    When I try to delete it, I have the following error:
    The specified file is not valid or too long. Specify a different file name.

    And it takes a lot of space in my hard drive.

    How is it possible to remove it?

    Thank you.
    Best regards
    Marc

    Original title: delete files with weird names

    Hello

    My corrupt files are found on a disk of material on my computer.
    I have re-formatted the full disk to remove these files.

    Best regards
    Marc

  • Try to install a printer, but keep getting the message error "the specified environment is not valid.

    So I try to reinstall a printer on a computer and I get the message that the printer cannot be installed and the environment specified is not valid.  It was working a week ago and now it is not.  The printer has already been uninstalled, so I'm stumped.  Any help would be appreciated.

    Printer is HP Laserjet 1020

    Hi miket219


    I suggest refer you to the below provided the link and download the latest drivers available for Windows XP on the Web site. Check that if the installation of the last driver put up-to-date helps you solve the problem-

    http://h20000.www2.HP.com/bizsupport/TechSupport/DriverDownload.jsp?prodNameId=439428&lang=en&cc=UK&prodTypeId=18972&prodSeriesId=439423&TaskID

     

    I hope this helps.

  • VISA (Hex 0xBFFF001E) error the specified state, the attribute is not valid or is not supported as defined by the resource.

    Hello

    First of all that I must say I just starting with control of the instrument using Labview. For this reason, it is possible that the problem I have is easy to solve. However, I am looking for any solution for the forum, but unfortunately I can't fint anything.

    While the situation is this: I'm looking to plug a power Analyzer (Yokogawa WT1800) with the PC through GPIB. To achieve this, I use the USB/GPIB Interface of Agilent 82357 B. The connection is done correctly because I can see and communicate with him through the Explorer NI MAX.

    In order to achieve control of the instrument using Labview, I downloaded and installed the driver of Yokogawa WT1800 (Driver instruments ykt1800) using the NI Instrument Driver Finder tool. The problem I have is that when I run the examples, I find the following error message:

    Error 1073807330 has occurred to the property (arg1) node in Yokogawa WT1800 Series.lvlib: Initialize.vi-> Yokogawa WT1800 series continuous measurement Normal.vi

    Possible reasons:

    VISA: (Hex 0xBFFF001E) the State specified, the attribute is not valid or is not taken in charge as defined by the resource.

    I tried to change the input of the open Visa arguments vi because I think that this is where is the problem, but I can't reach any solution. The following image is attached to the block diagram of the initialize.vi:

    Any help is appreciated.

    Thank you.

    I suspect the redirect property. Try to remove it.

  • VISA: (Hex 0xBFFF001E) the State specified, the attribute is not valid or is not supported as defined by the resource.

    I try to open a com port Seraglio in LabVIEW get this error:

    VISA: (Hex 0xBFFF001E) the State specified, the attribute is not valid or is not supported as defined by the resource.

    It occurs in ISA set up a Serial Port (Instr) .vi and seems to be related to the speed of transmission. If I use anything else than 9600, I get this warning. I need to use 115200. I can open successfully to other com ports at 115200.

    I am able to talk to this device using other Terminal programs to 115200 without problem. It is only through LabVIEW and NI MAX.

    The Unit presents itself as "Stellaris Virtual Serial Port (COM12)" in deveice Manager.

    Is there a way to get around this?

    Thanks in advance!


  • Key not valid for use in specified state

    OfficeJet 4630 receiving facility message "Key not valid for use in the State specified" while installing.  Printing of basic but no other software is loaded.  Operating system is Win 7

    Tried HP support chat for several hours, but has been disconnected after restart in the first chat and do not know what happened to the second.

    Have turn off all startup programs and I tried USB and wireless facilities.

    Any suggestions for something else to try?

    OK got things working. Support has been a day towards the end of the call, and I wasn't available? But they sent me the same instructions that give @gimini02. I didn't follow all the instructions, but I think that the key performs the installation connected to the administrator account. The account doest show up until you use the command net user described in the post from @gimini02. I close all running programs on the but did not have recording start or clean install.

    The installation ran no problem and everything is well afterlogging with the standard add l id.

  • Receive error message when you open Outlook; the path specified for the file G:\outlook...pst is not valid.

    I recently exported my outlook to a pst file and saved on my external hard drive.  Since then I get this message when I open Outlook "the path specified for the file G:\outlook...pst is not valid.  How to stop?

    NEVER use the. Functions of export/import PST in Outlook.  They are broken, have been for some time, data loss and often corrupt Outlook profile in use. To perform a backup, just close Outlook and make a COPY of the. PST file.  Looks like (and I guess here) your external HD is G:\. This being the case, that. PST file is probably still attached to Outlook and Outlook can't find it.  With Outlook open, see the supplement files pane. PST file, right-click, and then click "close".  You may need to have the hard drive external and exported. File PST attached and available for work.  If this does not work, you have damaged your profile and will need to make a new one:

    How to create and configure an e-mail profile in Outlook 2007 and in Outlook 2003

    HAL
    --
    HAL Hostetler, TCE
    Engineer senior/UPDATED--MS MVP-Print/Imaging - WA7BGX
    www.kvoa.com - KVOA television, Tucson, AZ.
    Live Hot Licks - www.badnewsbluesband.com

  • Task Scheduler error: "an error has occurred for task reminders - portable home. "Error message: the specified account name is not valid.

    HelloW everyone,

    I changed my name to the laptop and now every time I have lunch Planner task, I receive the following error message:

    "An error has occurred for task reminders - portable home. "Error message: the specified account name is not valid.

    I also have the problem with restore points, so these two issues relate to eachother? How can I solve the problem of the user name.

    Any suggestion and help appreciated

    Hello

    You can check out the link and check if it helps.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-performance/odd-Scheduler-error-messages/a487d70b-61c9-499F-ae15-ac903d6174eb

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following windows Help article.
    Back up the registry
    http://Windows.Microsoft.com/en-us/Windows7/back-up-the-registry

  • The specified account name is not valid, because account names cannot contain the following characters * {} [] +=? *

    Original title: can't do user account
    I can't do a different account on my windows vista computer.  When I try to make another account, it says this "the specified account name is not valid, because account names cannot contain the following characters * {} [] +=?" "*" even if I don't use any of those what should I do?

    the only account on my computer is a guest account, it's a story of administering it. This is - why it doesn't let me make a new account? had this problem for 2 years

    Hello

    Try these steps to create a new account:
    a. log on under an account that has administrator privileges.
    b. Click Start.
    c. type the three letters cmd in the search box.
    d. press Ctrl + Shift + Enter
    e. click "Run as Administrator".
    f. type the following commands and press ENTER after each one:
    net users
    NET user 'Jack' xxyyzz / add
    net localgroup administrators/add ' Jack'

    The first command displays all existing account names.
    The second command creates an account named 'Jack' with a password of "xxyyzz".
    The third command will make Jack administrator.

    Check the link for more help:
    Create a user account
    http://Windows.Microsoft.com/en-us/Windows-Vista/create-a-user-account
  • the specified account name is not valid

    When you try to configure a task in Vista Task Scheduler I receive the following error message after you configure all the parameters of the task: "is an error generated for task reminders - Desk Checkout (it's a username on the system, but not one that I'm logged in." (C'est aussi un nom d'utilisateur valide qui vous permet d'ouvrir une session sous) the specified account name is not valid.

    Hi JimErickson

    1. is the computer connected to a domain?
    2 have you tried to use the Task Scheduler in another account?
    3 have you tried to schedule the task through an administrator account?

    It seems that the account you are using doesn't have the rights to schedule the task.

    Let us know the answers to help you best.

  • Error: The specified CSK password is not valid.

    Hello

    I am able to install the application on the BBZ30 in DEBUG Mode, but as soon as I try to install it on the same device in RELEASE mode, I get error error: the CSK password specified is not valid.

    No idea what's causing this error and how to fix it.

    Thank you

    Joe

    This indicates that the password that you use to sign the app (a step not required for debug builds) is incorrect.  Note that there are two places, you set a password, one for your developer certificate (author.p12) and another for your BlackBerry token ID (bbidtoken.csk).  For the development of WebWorks, these must be the same.  To change your password BlackBerry ID token, use the link below.  Note that you need to sign on the same BlackBerry ID account that you used to sign the original version of your application.

    https://developer.BlackBerry.com/Codesigning/

  • The CSK password specified is not valid.

    Hello!

    I am creating an application web wrapper that points to a fixed URL. The application seems to work fine in debug mode. But I can't get the signed Release version. I use:

    • WebWorks 2.0.0.54
    • 32 bit Java 1.7.0_45
    • BB10 Device Simulator BB10_2_1.1925

    I followed the instructions and have generated a BlackBerry ID, downloaded a bbidtoken.cskand generated a developer certified using the following command:

    BlackBerry-keytool - genkeypair - storepass xyz - dname "cn = abc"

    The two lands of files in the folder AppData/Local/Research In Motion . I run the following command for the build version:

    WebWorks build - release - keystorepass xyz

    How I get messages indicating the creation of the packages and then the following message appears:

    [ERROR] The CSK password specified is not valid.

    I repeated the generation BlackBerry ID and then the next generation of developer certificate once, twice, three times... ten times... to nothing done.

    What I am doing wrong? And what CSK file is served here, the bbidtoken.csk or another file that I completely missed? Any help is greatly appreciated.

    Kind regards

    Well, I actually had time to read the text with a lot of attention to each step, then... Well... I should have done the first time around. If the problem was that I was specifying the password BlackBerry ID was too long. There is some text above the field that contains 6 to 10 characters which I had totally ignored.

    I'm surprised the shape does not check the length, or the error message does not indicate length as the problem, but still, I should have read this line here.

    Thanks for the help!

  • When I right click on the android project and click 'Signin for BlackBery world' it shows the following error: the specified CSK password is not valid.

    Please see the full error below

    [2013-10-08 12:17:53] Start the Mediaplayer project checklist...
    [2013-10-08 12:17:53] Skip Mediaplayer to check, because the apk file has not changed.
    [2013-10-08 12:30:22] Start the packaging Mediaplayer project...
    [2013-10-08 12:30:24] Start the Mediaplayer project checklist...
    [2013-10-08 12:30:29 - Mediaplayer] Finished verification warnings or errors, check for problems of view for more details.
    [2013-10-08 12:30:31] Start the Mediaplayer project checklist...
    [2013-10-08 12:30:31] Skip Mediaplayer to check, because the apk file has not changed.
    [2013-10-08 12:30:54] The RDK signature completion status: (C:\Users\Shravan\workspaceAndroid\Mediaplayer\dist\Android 4.3\Mediaplayer.bar) error: the CSK password specified is not valid.
    [2013-10-08 12:32:04] Start the packaging Mediaplayer project...
    [2013-10-08 12:32:04] Start the Mediaplayer project checklist...
    [2013-10-08 12:32:05 - Mediaplayer] Finished verification warnings or errors, check for problems of view for more details.
    [2013-10-08 12:32:07] The RDK signature completion status: (C:\Users\Shravan\workspaceAndroid\Mediaplayer\dist\Android 4.3\Mediaplayer.bar) error: the CSK password specified is not valid.

     

     

    Please help me

     

    Hello

    You link your old keys with your BlackBerry ID?

    You have the right code signing credentials in c:\Users\[USERNAME]\AppData\Local\Research in Motion\? (author.p12, barsigner.csk, barsigner.db)

    As an alternative, you can export the apk of eclipse and then try the packer online.

  • The account name is not valid, or the password is invalid for the account specified using Cobian Backup 11 name

    I did a new install of Windows 7 Professional on a workstation, and after all the updates, I installed Cobian Backup 11.

    When you set up backup Coabian first, the message "the account name is not valid, or the password is invalid for the specified account name" was shown.

    I went into the "services.msc" to manually set the password for the connection (the machine connects in a Windows Server 2003 domain), but when entering the dialog (properties/connection/account/local/search/select where you want to search for.) only the 'local computer' is displayed.

    I tried to enter the domain/user and the password manually, I logged in as administrator, I have excluded the uder from the server and have included him again, that I did everything in my mind but I couldn't solve the problem.

    Any help is welcome.

    TKS in advance.

    PS: Someone asked me what support Cobian said about it. To be honest I did not support Cobian because the other four machines were all as one that has the problem and two "local computer" and "directory of the whole area" appears.

    This retail driver to believe that the problem occurred is on the installation of windows 7 Professional.

    Hello

    We have dedicated support team for users on a domain network. I suggest you to report your query in the TechNet forums to improve assistance in this regard.

    Here is the link:

    http://social.technet.Microsoft.com/forums/Windows/en-us/home?category=w7itpro&filter=AllTypes&sort=lastpostdesc

    Hope this information helps.

  • Switch to the correct encryption certificate I get the error: "Key not valid for use is specified state."

    Used
    Now cannot open encrypted files.

    When you try to pass the correct encryption certificate I get the error:
    "Key not valid for use is specified state."

    See this http://answers.microsoft.com/en-us/windows/forum/windows_7-security/keeping-passwords-secure-microsoft-policy-on/39f56ef0-5d68-41ad-9daa-6e6019c25d37

    It is as it's supposed to as an anti theft precautions. I mean that data is encrypted, if somebody stole your hard drive and the hard drive boots and the other account it can receive data.

    If you not export recovery certificates and encrypting the data, you cannot redo the decryption.

    http://Windows.Microsoft.com/en-us/Windows/back-up-EFS-certificate#1TC=Windows-7

    If it's a default domain recovery agent. admin area. If it's home, to look for recovery certified you have exported.

    But third-party tools are there if you can remember old password the is to encrypt you can recover. But they are not free... and premium software is not be recommended or guided through support free forum due to the effort of preventing unnecessary advertising.

    You can do you own research about recovering data... just try to get you using the favorite search engine... "Restore access to encrypted EFS format files" or "Advanced EFS Data Recovery.

    Many more free guides will be available... Just keep in mind this is not a method to escape... you must remember your old password at least for decryption in the case where you export a certificate.

Maybe you are looking for