my visual studio is not opening in administrator mode on opening a project by clicking a solution. By default i set it as run as administrator. but, still it is not opening if i directly open the project by clicking the project solution file.
If you open Visual Studio, right-click on the Taskbar icon of it, and select Properties.
In the tab Shortcut, press the Advanced button and tick 'Run as administrator'. Click OK.
In the tab Compatibility, tick the 'Run this program as an administrator' option. Click OK.
Apply and close the properties dialog.
I changed those settings on my computer and it always starts in administrator mode.
This is a copy of my answer to a similar post on SuperUser:
Option 1 - Set VSLauncher.exe and DevEnv.exe to always run as admin
To have Visual Studio always run as admin when opening any .sln file:
Navigate to C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe.
Right-click on VSLauncher.exe and choose Troubleshoot compatibility.
Choose Troubleshoot program.
Check off The program requires additional permissions and hit Next.
Click the Test the program... button to launch VS.
Click Next, then hit Yes, save these settings for this program, and then the close buton.
To have Visual Studio always run as an admin when just opening visual studio directly, do the same thing to the DevEnv.exe file(s). These file are located at:
Visual Studio 2010
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Visual Studio 2012
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
Visual Studio 2013
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
Visual Studio 2015
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Option 2 - Use VSCommands extension for Visual Studio
Install the free VSCommands extension for Visual Studio (it's in the Visual Studio Extensions Gallery) and then configure it to always have Visual Studio start with admin privileges by going to Tools -> VSCommands -> Options -> IDE Enhancements -> General and check off Always start Visual Studio with elevated permissions and click the Save button.
Note: VSCommands is not currently available for VS 2015, but their site says they are working on updating it to support VS 2015.
My Opinion
I prefer Option 2 because:
it also allows you to easily turn off this functionality.
VSCommands comes with lots of other great features so I always have it installed anyways.
it's just easier to do than option 1.
Related
I have Visual Studio 2019 installed on an Azure machine and every time I run it, it asks for username and password which I enter. It then says Elevation is required. The System Admin grants this but it is only for 15 mins. What permission do I need to be able to run VS19 without permission or elevation? Systems Admin doesn't know either.
Run Visual Studio as an administrator follow these steps to open the IDE:
NOTE: These instructions are for Windows 10. They are similar for other versions of Windows.
Open the Start menu, and scroll to Visual Studio 2019.
From the right-click or context menu of Visual Studio 2019, select More > Run as administrator.
When Visual Studio starts, (Administrator) appears after the product name in the title bar.
You can also modify the application shortcut to always run with administrative permissions:
Open the Start menu, scroll to the version of Visual Studio that you're using, and then select More > Open file location.
In File Explorer, locate the Visual Studio shortcut for the version that you're using. Then, right-click the shortcut and select Send to > Desktop (create shortcut).
On the Windows desktop, right-click the Visual Studio shortcut, and then select Properties.
Select the Advanced button, and then select the Run as administrator check box.
Select OK, and then select OK again.
For reference follow this Visual Studio 2019 troubleshoot
Or, When it shows elevation is required ,
Please close the VS Installer and try running it as administrator from start menu.
Or trying to run
C:\Program Files (x86)\Microsoft VisualStudio\Installer\vs_installer.exe directly.
Upgrade to VS 2017 and now I there is no references available to Microsoft.Office.Interop.Excel
Where did the reference go?
You should be able to "Add reference", select "Assemblies", press the "Browse" button, traverse to a path along this line (most likely close to your machine but slightly different):
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Visual Studio Tools for Office\PIA\Office15
Then you should see to select:
(Source Stack Overflow user: #karen-payne)
Go to Visual Studio Installer under Individual Components and click 'Office Developer Tools for Visual Studio. This solved it for me after lots of headaches.
Visual studio 2012 crashes when I try to edit .hlsl or .fx files, even after I disabled all of my extensions. I also uninstalled Parallel NSight and NShader but the syntax highlighting still shows up for these file types (and seems to be the cause of the problem). Renaming my shader file to have a different extension doesn't cause any problems. Is there a way to manually remove custom syntax highlighting rules?
UPDATE:
Resetting the user data solved my problem.
devenv.exe /ResetUserData - Removes all user settings and makes you set them again. This will get you the initial prompt for settings again, clear your recent project history, etc.
How do I truly reset every setting in Visual Studio 2012?
Make sure you have all updates/service packs installed. I don't know if there were any VS 2012 service packs, I use VS 2008 SP1 which is last really stable version known to me.
Rename or move temporarily your Visual Studio 2012 folder which is located in "Documents". Visual Studio will create new one.
Open VS and see if it helped. If not - problem is elsewhere, so rename/move your Visual Studio 2012 folder back and go to step 3.
Backup your Visual Studio settings (Tools -> Import and export settings -> Export...) and then reset them to default (Tools -> Import and export settings -> Reset...).
Open VS and try again. If settings reset didn't helped - restore your settings from backup. If it helped - you can import settings by categories and see which one is messed up.
Reinstall Visual Studio, something must be messed up in Program Files.
I have VS 2012 and 2013 installed on my system.
I have a 2012 project that I want to get pulled up in VS 2013 when I double-click it from the Windows Explorer.
Is this possible?
If you only want specific slns to open in 2013, you can open the sln file in a text editor, and change the line
# Visual Studio 2012
to
# Visual Studio 2013
Note that it will ask you to upgrade the projects to 2013 when you open it for the first time. If you want all of 2013's compiler features you will have to upgrade, but if you chose not to it will still load in the 2013 IDE and you get some of the IDE related features.
Right click any solution file and select Open with... option. Use Visual Studio Version Selector as the default program to use for Visual Studio solution files.
When I'm trying to open any solutions that worked fine before in Visual Studio 2012, the error "Package 'Visual C++ package' failed to load" keeps showing up. And the solution can't be opened.
I'm not sure what's wrong with my Visual Studio 2012 installation.
click the TOOLS--->VISUAL STUDIO COMMAND PROMPT to open the command window
input the command "devenv /Setup"
open the visual studio 2012 again, it will works.
Source: http://happyivyli.blogspot.com/2013/07/visual-c-package-failed-to-load.html
Running command prompt from inside Visual Studio.
For easier access, you can add the Visual Studio Developer Command Prompt or any other command prompt to the Tools menu on Visual Studio, by adding it to the external tools list. This is how you can accomplish that:
Open Visual Studio.
Select the Tools menu and choose External Tools...
On the External Tools dialog box, choose the Add button. A new entry appears.
Enter a Title for your new menu item such as Command Prompt.
In the Command field, specify the file you want to launch such as %comspec% or C:\Windows\System32\cmd.exe.
In the Arguments field, specify where to find the specific command prompt you want to use such as /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" (this will launch the Developer Command Prompt installed with Visual Studio 2015). This value needs to be changed according to your Visual Studio version and installation location.
Choose a value for the Initial directory field such as Project Directory.
Choose the OK button.
After that, the new menu item is added and you can access the command prompt from the Tools menu.
Then:
Right-click the Visual Studio icon
Choose Run As Administrator
Click the menu TOOLS → *Command Prompt** to open the command window
Input the command "devenv /Setup"
Open Visual Studio again, and it will work.
None of the solutions I found around, including those listed here, seemed to help. What did work was going in the software install/uninstall management, right clicking on Visual Studio and choosing "change" (that's where you would normally uninstall something from).
That should pop up the Visual Studio package manager, and from there you can choose repair.
In my case, looking at the systems backlog and restore points, it seems it was one of the Visual C++ redistributables, possibly installed by some game, that compromised the environment.
This is on Windows 8.
Possibly same fix as this https://stackoverflow.com/a/21266545/990618
Check your User environment variables for VCHOME, VCINSTALLDIR and vsinstalldir.
Change
X:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
to
X:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\
Or
X:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\
depending VS 2012 or 2013.