Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7945451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:52:11+00:00 2026-06-04T00:52:11+00:00

I have an application that requeres to register a dll into a gac on

  • 0

I have an application that requeres to register a dll into a gac on a client computer everytime a new dll is deployed the problem is that the client computers only have restricted users with UAC turned on.

The application knows the credentials of a user that has admin rights.

The problem is if I have processStartInfo.UseShellExecute = false; then I can’t get trough the UAC getting the error “The requested opperation requires elevation”
and if I have processStartInfo.UseShellExecute = true; then it does not allow to run the whole thing as a different user: “The process object must have UseShellExecute property set to false in order to start the process as a user”

        internal static void Register(String assemblyName)
    {
        ProcessStartInfo processStartInfo = new ProcessStartInfo(lcDir + "gacutil.exe", string.Format("/i {0}.dll", assemblyName));
        processStartInfo.UseShellExecute = false;
        processStartInfo.WorkingDirectory = lcDir;
        processStartInfo.UserName = lcUser;
        processStartInfo.Password = Password;
        processStartInfo.Domain = lcDomain;

        processStartInfo.Verb = "runas";

        Process process = Process.Start(processStartInfo);
        process.WaitForExit();
    }

I would like to know what the “Best practice” for that kind of thing is? I know the whoe concept looks to windows like a virus.

What I would like to achive the following:

  • User dosen’t need to know an account with admin rights
  • The credencal’s of the admin user are saved in the program’s database
  • As much as possable Automated registration.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:52:17+00:00Added an answer on June 4, 2026 at 12:52 am

    You should run this part of your code as Administrator.
    What you need is impersonation.

    See this article

    Aricle Impersonation on Code project

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that requires msvcr71.dll. In some machines the DLL is missing.
I'm fairly new to iOS development and have an application that requires a login
We have a new application that requires glibc 2.4 (from gcc 4.1). The machine
I have an application (Windows service) that is installed into a directory in the
I have an application that requires processing multiple images in parallel in order to
I have an application that requires resizing of a component that will be scaled
I have an application that requires Microsoft VC++ 2005 (SP1) Redistributable Package. I know
I have an application that requires a sequence to be present in the database.
I have a WinForms application that requires some configuration which I do at install
I have an android application that requres a login based on users in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.