I am using VS 2017 Enterprise.
I have it setup to open/run in Administrator mode which is working for SLN files.
However I'm trying out the new "Open in Visual Studio" feature by right clicking on a folder in Explorer. I'm receiving the following permission error. It's happening for every folder I try.
VS Code has no problem however.
Is there something more I need to enable?
My first guess would be that the VS 2017 application itself (devenv.exe) is configured on that machine to always Run as Administrator see https://technet.microsoft.com/en-us/library/ff431742.aspx on how to change it:
To mark an application to always run as an administrator, do the following:
1. On the Start menu, locate the program that you want to always run as an administrator.
2. Right-click the application’s shortcut, and then click Properties.
3. In the Properties dialog box, click the Compatibility tab.
4. Do one of the following:
- To apply the setting to the currently logged-on user, select the Run This Program As An Administrator check box, and then click OK.
- To apply the setting to all users on the computer and regardless of which shortcut is used to start the application, click Change Setting For All Users to display the Properties dialog box for the application’s .exe file, select the Run This Program As An Administrator check box, and then click OK twice.
See also list of things that you can't do without administrator account https://msdn.microsoft.com/en-us/library/jj662724.aspx. What typically makes Web-developers to make VS always run as administrator is "Deploying a web application to Internet Information Services (IIS) on a local computer." and "Debugging applications that a run under a different user account, such as ASP.NET websites."
For me it has worked as it should, at least this can help you.
First question is how you "setup to open/run in Administrator mode" ?
Using the "Advanced button" of the Visual Studio 2017 shortcut is not enough because methods with the right mouse button don't use this shortcut.
Using the method of the compatibility tab as mentioned already by SergGr
(https://technet.microsoft.com/en-us/library/ff431742.aspx) has worked for me, and I have been able to use it for folders as well as for solution files !
I am logged in as a member of the local admin group and UAC standard setting into Win 8.1 .
Another possibility instead of using the compatibility page would be to inject an own manifest into devenv.exe. Neither of the two is very clean (I am no fan of the whole compat layer, but it helps here a bit).
Have you tried to switch UAC off temporarily for a test? Or how you have configured UAC?
If you have done it the way described, the explorer should come up with a correct UAC message.
This works for me if not for you then refer to (https://marketplace.visualstudio.com/items?itemName=GregTrevellick.OpeninVisualStudio2017Enterprise):
1. open notepad.exe and paste this into it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
#="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
here is my registry file exported just incase you need it (you shouldnt):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
#=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,53,00,20,\
00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,00,78,00,\
65,00,22,00,20,00,22,00,25,00,31,00,22,00,00,00
2. save as VSElevated.reg
3. go to where you saved the .reg file and double click, yes to everything and ok.
4. This is how your Registry should look like afterwards:
The reason i think is the %1 is missing in your launch command. This should solve it.
I am using InstallShield 2015 Limited Edition with Visual Studio 2010 to create an installer for a variety of different files, including executables, some Excel spreadsheets, and html pages. The executable files are created by NetBeans. The installer works fine, except for the following behavior with a created shortcut that I don't understand.
NetBeans creates 2 executables: myapp.exe, which is 32-bit, and myapp64.exe, which is 64-bit. I am creating non-advertised shortcuts for these two files. The shortcut for myapp64.exe is created as a "Run as Administrator" shortcut, where the little shield picture is embedded in the shortcut icon, and double clicking the icon brings up the typical prompt window when trying to run an app as administrator. When looking at the Compatibility tab in the shortcut properties, "Run this program as an administrator" has been checked for all users.
The shortcut for myapp.exe is "normal". It can be run as administrator from the right-click context menu, but it is not forced to do so because "Run this program as an administrator" is not checked on the Compatibility tab.
I would like for both shortcuts to be created as "normal", to avoid the annoying prompt window, but I can't figure out why the shortcut for myapp64.exe is created as a "Run as Administrator" shortcut. I checked myapp64.exe with the MT tool, but there is no manifest, and the properties for myapp64.exe do not require admin privileges anywhere that I can find. I can't find any InstallShield settings that would make the shortcut "Run as administrator". I have deleted and re-created the shortcut in the installer project, but that doesn't solve the problem. If I manually modify the shortcut for myapp64.exe after installation to uncheck "Run this program as an administrator", the app runs fine.
Finally, this behavior doesn't seem to happen all the time. It happens in Windows 7, but does not seem to happen in Windows 10. I am only working with 64-bit operating systems.
Any ideas what is going on, or how to prevent the myapp64.exe shortcut from being created to run as an administrator? Is the Windows Installer seeing something that is causing it to make the shortcut this way?
I posted in the Flexera forum for InstallShield LE, but didn't get a response.
Thanks!
I'm really tired of this error.
Most of the time, when I want to debug the program , I'm faced with this message.
Microsoft to offer solutions, but it is quite confusing:
1.
Make sure the Visual Studio Remote Debugging Monitor is installed and running on the remote machine.
2.
Make sure the Remote Server Name is correct in the Name box in the Project Properties dialog box.
3.
Verify that the remote machine is accessible on the network.
please someone help and guide me because all of my projects have been suspended and i need visual studio debugging.
meanwhile, when i dc from internet, visual studio will work.
Windows 7 x64, VS 2012, VB.NET
I fixed it like this:-
Create a shortcut on your desktop to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe".
Right-click shortcut and select "Properties" from the dropdown menu.
Select the "Compatibity" tab
Tick "Run this program as administrator"
Click OK
Create a shortcut on your desktop to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe".
Right-click shortcut and select "Properties" from the dropdown menu.
Select the "Compatibity" tab
Tick "Run this program as administrator"
Click OK
To start VS2012:-
1) Double-click the msvsmon shortcut icon (that you created above, to launch msvsmon)
2) Double-click the "Visual Studio 2012 Professional" shortcut icon (that you created above, to launch VS2012)
3) In VS2012, ensure standard toolbar is visible.
4) In VS2012, ensure "Solution Platforms" dropdown (on standard toolbar) is visible and set to "x86".
and ... wowee ... debug works !
I had the same problem. I fixed changing in properties/compile/target platform to x86 instead of Any CPU. It was the problem in my case. Hope it helps.
I got this error when starting VS2012 as a normal user. When starting as an administrator it opened up a UserControl TestContainer window instead.
What have happend was that the startup project was changed. I changed back to my ordinary startup project by right-click on it and choose "Set as StartUp Project".
I have started vs 2012 as administrator and it is fixed
I installed Windows SDK before and there was an option showing up in Visual Studio to test an application by debugging. I had to reinstall the SDK again but the only Option I was seeing was Start instead of any other WVGA OR WXGA simulator. Is there anyway I can fix this? Hyper-V option is also enabled and I am using 2011 Macbook Air 13.3"
If the options you refer to are the ones in the Visual Studio menu with the green arrow, it only shows the options for the StartUp project (the one which is bold in the Solution Explorer).
If you set your Windows Phone project as StartUp project (right click on the project, and select "Set as StartUp project"), you will see the mentioned emulator options on the menu.
Other option is to right click on the project, select Properties, and in the Debug tab, select the desired Target Device.
Using Visual studio 2010 I got problems when double-clicking, for example a config file (*.config). Visual Studio would open but give me a error message about parameters. If I simple try to drag and drop a file that Visual Studio usually can read in to it, the icon will give me the "not possible icon"?
I have now installed Visual Studio 2012 and it has the same problem?!
This makes my work a lot harder, it should be easy to just drag & drop files into Visual Studio, but it's not so? Now I have to manually find the file with the file menu?
Please note, I have re-installed the computer before installing Visual Studio 2012.
On Windows Vista and newer Windows Explorer runs with medium integrity level.
If you run Visual Studio as administrator (high integrity level) then for security reasons OS will disable drag and drop from Explorer to Visual Studio.
You can either run Visual Studio as normal user or you can install VSCommands for Visual Studio 2012 extension. It has several features that can help with this such as:
Elevated Windows Explorer - small tool which looks like Windows Explorer but runs with elevated permissions allowing Drag And Drop
Directory Explorer - tool window inside Visual Studio which again looks like Windows Explorer and allows Drag And Drop
Run Visual Studio with medium integrity - allows Drag And Drop from Windows Explorer, but you won't be able to attach to processes run by other users (e.g. IIS)
If you run VS as administator, instead drag n drop, do copy (either ctrl+c, context menu "copy") the file selection in explorer and paste (ctrl+v, context menu) on selected node in VS
This was driving me nuts. In my Visual Studio solution I have two Web Application which use IIS as web server so because of this I have to always start my Visual Studio in Administrator mode. After starting as Admin I wasn't able to drag and drop files from Explorer to Visual Studio.
Solution:
Open Command Prompt as Administrator (Shortcut for Windows 8.1 is ⊞ Win + X + A)
Type "explorer" this would open Windows Explorer with Admin privileges.
And now you should be able to drag and drop any file from explorer to Visual Studio
If you disable UAC completely you can drag & drop from anywhere again. To do this you can't use the slider in the Control Panel because that only brings the UAC level down to 1. Make this registry change, reboot, and you can again use your computer like god intended.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLUA"=dword:00000000
I think the main goal of this question is how to add many folders and files to your project in a comfortable way. Drag and Drop files into your project is one solution, which fails under certain circumstances.
Another very easy way is:
Copy the new folders and files where you physically want them in your project
Open the project explorer in VS and click the button "Show all files"
All the folders and files, which are now not part of your project yet appear white
Select the the white folders or files, right-click and choose "Bind to project"
Done
This is also possible, if you run VS as admin.
Have some fun!
By the way: I found this question, because I had the same issue with drag and drop. I understand the security issues, but it is an annoying feature.
I'm using this easiest approach. When you run Visual Studio in Administrator Mode. When you need to drag and drop, just press CTRL+O to open up a file browser within visual studio, and use that file browser as an Elevated Explorer to do your drag and drop.
I had a similar problem but my issue was a bit different. I was trying to drag and drop a file from inside a zipped folder. Once I unzipped the folder drag & drop started working again.
I had this problem as well because I was opening VS in admin mode and the file explorer by default is not in admin mode.
Ended up creating a PowerShell and bat script to start explorer in admin mode every time the computer start.
admin.bat file:
#ECHO OFF
PowerShell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}"
admin.ps1 file:
taskkill /f /im explorer.exe
start-process explorer.exe
The files just have to be in the same folder. Doesn't matter what they are called. Run the .bat file to restart explorer in admin mode or just create a shortcut to the .bat file in the startup folder ;) the script and ps1 file can be hidden.
On windows 8.1, change the registry key: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA and set value = 0.