.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Running process with non admin rights

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :.NET Framework


I have created an UPDATE application  that basically update my acutal application.

My actual application has one executable and one windows service. Till now my Actual application and update application was working under users of administrative group. But now customer is mentioning that all users should be from users group not administrators group.

My application is already deployed to various remote locations . But now my update application is failing since first step of my application is to stop the windows service. Since now users are logged in with user account i am not able to stop the service.

Please recommend some solution in this scenerio




S H1


View Complete Post

More Related Resource Links

Help with running external Process from button click

We need assistance with a portion of a major web application project scheduled to begin user testing within 10 days.  The troublesome part of the code calls an external application when a button is clicked in Web page.  When run from a command prompt or bat file, the external application, App.exe, runs perfectly producing the desired result.  We created a test page and a small console application, Con.exe, to test the button code with a known quantity.  The test application runs perfectly when the button in the Web page is clicked.  However when we change the code to run App.exe instead of Con.exe, the App.exe code will not execute.  We even tried creating a bat file to execute App.exe.  Like the exe, the bat file executes from the command prompt or when double-clicked, but fails to run when called as a process from the button click event.  Can anyone assist us?  Here is the C# code: (.Net 3.5 sp1) using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Diagnostics;   namespace WebButtonTest {     public partial class _Default : System.Web.UI.Page  &nbs

When i start a process and running an external program is there any way to set the program window po


  private void View_Log_File_Click(object sender, EventArgs e)

            if (processNotePad == null || processNotePad.HasExited)
                processNotePad = System.Diagnostics.Process.Start("notepad.exe", "\"" + path_exe + "\\log\\logger.txt\"");


The problem is after the program the process started and i see the program when i click somewhere on the form1 the main application window the window of the process program is moving

Can I invoke a sleeping thread by name which is running inside the same process


I have an web application in which Application start event I have started some thread.In those threade one thread name is "JobManagerThread" which is quering the database after each 2 minutes and if found some record then do proccessing otherwise sleeps.

Now From one of my page i wanted to trigger that Thread [that is if it is sleeping then i wanted it to start]

can it be possible?

I am working with .net framework 3.5

"The agent process was stopped while the test was running."


I have a solution that was originally created using VS 2008. I have quite a few unit tests that all passed when ran in VS 2008.

Yesterday I opened this solution in VS 2010 and converted it using the wizard. The solution built just fine, it runs just fine, BUT now all tests that access the db fail. I get the same error on every test (below).

"The runtime has encountered a fatal error. The address of the error was at 0x5b3b5ad7, on thread 0x19a4. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack."

In test classes that use ClassInitialize() and ClassCleanup() methods, all the tests fail. All tests fail with the same error, "The agent process was stopped while the test was running."  Tests in test classes that do not utilize ClassInitialize() and ClassCleanup() (these tests do not hit the database) all pass.

When this was a VS2008 project all 153 tests passed. No changes have been made to these tests, other than converting the project to a VS2010 project.

I've been playing around with one test class. I commented out the ClassInitialize() and ClassCleanup() methods. I rewrote one test me

Getting "The process must have access rights for the private key." clientside error when the process


When I run my client side code I keep getting this error:

The certificate 'CN=WCFClientCert' must have a private key. The process must have access rights for the private key.

The ClientCert certificate is in my Current User\Personal\Certificates store.

I created it using:

makecert -sk WCFClientCert-iv WCFServiceCA.pvk -n "CN=WCFClientCert" -ic WCFServiceCA.cer -sr CurrentUser -ss My -sky exchange -pe WCFClientCert.cer

, so I did do -sky exchange and -pe.

I used findprivatekey.exe to find the location of WCFClientCert's key, and went to its location in the directory. But the file already had all the permissions I could think of. Administrator, COMPUTERNAME\Users, the account I log into, SYSTEM, etc.

I have run the client code from both within Visual Studio 2010s Debug mode, and from building the project and its setup/deployment project and actually installing it on a machine. The actual installation was on another machine, but I am getting the same error.

The WCF Service is on a separate server, and I received this error when installing the service, but fixed it by adding the NETWORK USER user to the permissions on the key file. (service is hosted on IIS).

So why am I receiving the same error on the client side, but the same solution does not work?


Thank you in advance for any he

Error running Document Aprpoval Process application sample


Hi all,

I download and install the application samples for Windows Workflow Foundation 4 on my machine. When I try to run the Document Approval Process example the ApprovalManager project runs fine but when I start the ApprovalClient.exe I run into problems. Can anybody help?

My environment is: Windows 7 64-bit with VS2010. The only change I have made is that the Express Db's name is '(local)' instead of 'localhost\SQLExpress' and I have changed this in the App.Config file.

Thanks in advance for your help.


Here is the error files:


<?xml version="1.0" encoding="UTF-16"?>
    <MATCHING_FILE NAME="ApprovalClient.exe" SIZE="36864" CHECKSUM="0xA99D9EE4" BIN_FILE_VERSION="1.0.3971.16290" BIN_PRODUCT_VERSION="1.0.3971.16290" PRODUCT_VERSION="1.0.3971.16290" FILE_DESCRIPTION="Microsoft.Samples.DocumentApprovalProcess.ApprovalClient" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Windows Communication Foundation and Windows Workflow Foundation SDK" FILE_VERSION="1.0.3971.16290" ORIGINAL_FILENAME="ApprovalClient.exe" INT

Running external 32 process from 64 bit OS


I am using System.Diagnostics.Process.Start() to run an external program.

I am seeking to find the best method to handle running an extrnal 32 bit application from my C# project whether it is being used on a 32 or 64 bit platform.

The path to the the external program is configured centrally for all workstations. So at the moment when I invoke the Process.Start("C:\Program Files\MyProgram\MyProgram.exe"), it works when invoked from a 32 bit OS, but not on a 64 bit.

I know I could programatically detect the OS type and alter the file path accordingly, however I thought that there was a method where this was handle automatically.

i.e. When "C:\Program Files\MyProgram\MyProgram.exe" is invoked on 64 bit OS, the system will know to execute it from "C:\Program Files\MyProgram (x86)" instead.


"SharePoint Foundation Help Search" support Central admin running as HTTPS?


I'm getting the following error after enabling SSL on the SharePoint Central Admin web application each time the timer job runs every hour.  Does the "SharePoint Foundation Help Search" support Central admin running as HTTPS?    I verified the certificate public key is installed in the "Managed Trust" list.  The site is using NTLM for authentication.

The start address sts4s://spc-test.company.com/contentdbid={7881ba06-985a-4582-a798-bd3526ce9687} cannot be crawled. Context: Application 'Search_index_file_on_the_search_server', Catalog 'Search' Details: Access is denied. Verify that either the Default Content Access Account has access to this repository, or add a crawl rule to crawl this repository. If the repository being crawled is a SharePoint repository, verify that the account you are using has "Full Read" permissions on the SharePoint Web Application being crawled. (0x80041205)

.NET problem - no text appears when not running under hosting process


I have the most annoying problem with .NET Framework 4 (both full and Client Profile).

Basically, when I debug my application under the hosting process (vshost), the problem doesn't occur. I've found it only when I ran the .exe directly from it's location, and now I see that it happens when I debug it as well, but not under hosting process.

The problem is that I cannot see any text inside the labels, inside message-boxs (even the Yes-No text from the buttons has dissapered), from buttons or text-boxs, it simply dissapears.

I tried creating a new .NET Framework 4 project, and the problem didn't appear. So I decided to re-create my application from scratch (almost from scratch). I've created a new solution file, new project files and included the .cs and .resx files from my previous solution. The problem persisted.

Interesting thing is though, that on my first solution I've changed the configuration platform to 'Any CPU' from 'x86', and the problem then appeared in either cases (even while running under the hosting process).

I wrote the app in VS2010. I am running on Windows 7 Professional 64-bit, SP1.


Please help!

ASP.NET Architecture - ASP.NET Worker Process - HTTP Pipleline - Http Modules and Handlers

"ASP.NET is a powerful platform for building Web applications, that provides a tremendous amount of flexibility and power for building just about any kind of Web application. Most people are familiar only with the high level frameworks like WebForms and WebServices which sit at the very top level of the ASP.NET hierarchy. In this article I'll describe the lower level aspects of ASP.NET and explain how requests move from Web Server to the ASP.NET runtime and then through the ASP.NET Http Pipeline to process requests.

Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

Client script not running


Dear all,

in my MVC 2 application, and in the shared Master Page I wrote this little script for menu handling :

<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript"> $(document).ready(function () {   
     $('#nav li').hover(  
         function () {  
             //show its submenu  
             $('ul', this).slideDown(100);  
        function () {  
           //hide its submenu  
            $('ul', this).slideUp(100);           

The script, that shows menu items when the

Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




For Multi-Language website which process is better in asp.net


 I want to build multi-language website in asp.net 2008 and asp.net 2010. So, which process is better for building application? Using either Local and Global Resource or New Folder to make separate according to language?


Application performance should be good and also easy manageable.


Please suggest me in which way I will build the application either using resource or folder. If there is any other better solution then please share.

CLR Inside Out: In-Process Side-by-Side


The new .NET Framework 4.0 maintains backward compatibility while allowing core innovations by using a new feature called In-Process Side-by-Side. Learn about how it works and some problems it didn't solve.

Luiz Fernando Santos, Jesse Kaplan

MSDN Magazine December 2009

ASP.NET Workflow: Web Apps That Support Long-Running Operations


Integrating workflow into ASP.NET applications means communicating with activities via a workflow queue and hosting the runtime in the global application class. We'll show you how.

Michael Kennedy

MSDN Magazine January 2009

Team System: Streamline Team Projects With Process Templates


See how you can streamline your team projects using Process Templates in Visual Studio Team System (VSTS)

Brian A. Randell

MSDN Magazine December 2008

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend