简体   繁体   中英

Console Application stopped working

Is it possible for code to work perfectly on the Administrator profile and not work at all while logged in as another user?

I am building certain applications at work, and while developing, coded and tested while logged on as Administrator. Every application working normally.

Now before deployment, when I execute the same application, but now logged in with a specific user account, I just get the error "Console Application stopped working" etc etc. I have handled all possible exceptions with my own Message Box, but this error is something I did not expect?!

In the exe's, I tried changing setting to "Run as Administrator", no use!

Any help would be much appreciated. Thanks!

PS - There are certain FTP methods I reuse from another class. And by handling all possible exceptions, I mean, I would have a try-catch block for the FTP method, so in case of error encountered after deployment, affected user may call helpdesk and notify the exact error.

Well, its not the right way to go, but right click and run as Admin, works butter smooth. Should I go ahead and modify all executables to - Run as Administrator under Properties->Compatibility??

You should firstly investigate if your application does need Admin rights indeed. A few scenarios that I can think of where an App needs admin rights are writing to protected locations of the system, writing to registry (excluding the areas that the user has rights on). If you think that admin access is not needed, you could always seek other ways to make it work. For example, instead of writing to a protected location, create a directory for you application in the user's application data folder and write to that location.

When you launch the application, if you're running on I believe Windows Vista or higher(7 works this way for sure)

You can Right click on the application and click on Run as Administrator

And yes, Sometimes the application won't work if you're not running as an administrator. For instance, If it's trying to change files in a protected location.

There are other variances that can cause your program to not work, For me, "Console Application stopped working" normally means that you don't have the right version of the .net framework installed, but it can mean any number of things.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM