VS2019 debugging of Notepad++ source code yields admin mode



  • So I have Visual Studio 2019 Enterprise (oh, boy) and I’m able to build the Notepad++ source code with it (well, after a few tweaks to the project settings…). Note that I’m building the non-Boost, non-Scintilla portion of the code. My understanding is that if I don’t want to change the Scintilla code (in my hacking efforts), I can just change the “Notepad++ part of the code” (for lack of a better name), and get a notepad++.exe file generated, then copy all the other files from a portable release into the generated notepad++.exe’s folder and bob’s-your-uncle there I have it.

    It all seems good…except for when I want to single-step debug with the VS IDE. Well, that’s mostly good, too, except…when the Notepad++ window opens it has the dreaded “Administrator” in the title bar. I really don’t want this, but I suppose it doesn’t interfere with what I’m doing…but it bugs me.

    It seems to come from VS2019 running in Administrator mode (thus launching N++ the same way); well, there’s a big fat ADMIN box in the upper right of that program:

    Imgur

    The thing is, I don’t see how I’m starting VS in admin mode. Some web searches turned up a few nuggets about earlier VS’s doing this same thing, but no tangible solutions. So this forum clearly isn’t VS tech support, but I’m just wondering if any of my N++ using brothers/sisters that are brave enough to build the source code have encountered something like this?



  • @Alan-Kilborn No, I’ve been using VS2019 for long time (since it was in preview). I haven’t faced such issues.





  • @andrecool-68 said:

    Run Visual Studio as an administrator:

    Hmmm. I think you totally misread or misunderstood my posting.

    Well, the thing is, this is what my shortcut that runs VS2019 looks like, and it is telling it NOT to run as administrator:

    Imgur

    I am definitely a non-administrator account on this PC (my work PC where I have no choice about what I am).

    My overall point is that everything points to VS2019 should not think I’m an admin when it runs but yet it DOES!



  • @Alan-Kilborn what if you execute it from command line (e.g. running "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" in command prompt.) If it work fine, then re create your short.



  • @SinghRajenM

    Thanks, but no luck running from the CMD prompt either (still comes up with ADMIN and runs N++ as Administrator as well). I suppose it isn’t a huge problem for me as I don’t think N++ in Administrator mode will interfere with what I’m experimenting with.



  • Weird problem, @Alan-Kilborn.

    I don’t have VS, so cannot experiment. But I was curious, and did some searching (sometimes google gives better answers to one person than to another).

    • I’ve found mentions that if UAC is disabled, it will always run as admin, but in your work-context, I doubt you have UAC disabled.
    • Another place, which was actually trying to force Admin, was saying you could apply the run-as-admin to the devenv.exe itself, and that would override your shortcut’s settings… so maybe devenv.exe itself has been forced to run-as-admin for you. That post also gave some registry entries to check…
    • Yeah, this one was someone specifically wanting to undo always-run-as-admin, so you might try those steps (once again, it looks like it’s applying the properties directly to devenv.exe, not to your shortcut.)

    Good luck



  • @PeterJones

    Weird problem

    If you’ll recall, I also had a posting some time ago about Notepad++ (versions before 7.6.6) ALWAYS running in Admin mode. Soooo…admin mode tends to be my nemesis. :)

    Actually I think the wacky way my I.T. dept. must be setting stuff up is my true issue.


    I did some of that same research.

    I’ve found mentions that if UAC is disabled, it will always run as admin, but in your work-context, I doubt you have UAC disabled.

    You are correct.

    I saw those other links as well. I’ve tried it all and then some. Nothing works but I can let it go…just like I did with my earlier admin problem with N++.

    [ Did you see the really lame responses by Microsoft support to some of these types of queries? LOL ]



  • @Alan-Kilborn said:

    I did some of that same research.

    I assumed you would have. But I know that often, I just don’t come up with the right combo of keywords for google to give me the answer that I need. Sometimes it just takes another googler to find it for you – well, for me, anway. Obviously, I didn’t find it for you :-)

    I was hoping you would find a solution. There have been hints at work that a project or two down the road (so probably next year), I’ll be switching from my proprietary-program-language-to-support-hardware-A which I’ve been using for the last decade to a VisualStudio/C++ -with-proprietary-libraries-to-support-hardware-B… so if VS is going to be giving RunAsAdmin difficulties, I was going to want someone else to have blazed the trail to a solution for me. :-)


Log in to reply