Visual Studio Version Selector Doesn't open - visual-studio

I have Visual Studio 2008 and 2010 installed side by side, but trying to open either a 2008 or 2010 sln file results in nothing. The hour glass comes on for about a second and then it goes away and nothing is opened.
I read somewhere to relate sln file to VS directly, but I can't go that route because I don't want 2008 solutions to open with 2010. Does anyone know what the problem might be and how to fix it?

If you are running Vista or Windows 7 with the UAC enabled and have "Run this program as an Administrator" checked on the Compatibility tab for the Visual Studio exe (devenv.exe), you will get this behavior when you try to open a sln file directly from Windows Explorer.
One solution is to go to "%ProgramFiles%\Common Files\Microsoft Shared\MSEnv" or ("%ProgramFiles(x86)%\Common Files\Microsoft Shared\MSEnv" for 64-bit systems) and right-click VSLauncher.exe and select Properties. On the Compatibility tab, check "Run this program as an Administrator". Now when you try to open a sln file directly from Windows Explorer, you will get the elevation prompt and it will open the correct version of Visual Studio for the file.

Apparently, the "run as administrator" hack does not work anymore in Visual Studio 2010 SP1. Fabian describes a workaround here:
Getting Visual Studio 2010 SP1 to run elevated when launching .sln files
To sum it up:
Backup VSLauncher.exe
From within a Visual Studio 2010 Tools prompt, extract the manifest from VSLauncher.exe:
mt -inputresource:"VSLauncher.exe" -out:VSLauncher.exe.manifest
Alter the VSLauncher.exe.manifest file:
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false">
</requestedExecutionLevel>
</requestedPrivileges>
Write back the manifest into VSLauncher.exe:
mt -outputresource:VSLauncher.exe -manifest VSLauncher.exe.manifest

The really annoying thing about this problem is that you have to run Visual Studio as administrator under windows 7 to attach to an IIS instance. The least they could do was not break the .sln files when you do that!
The post by Jorge Poveda is correct though, the original hack no longer works but his does. It's maybe worth mentioning that you have to run everything as administrator for it to work (the command prompt and text editor).
I think there is a better way though as we have Win 7 at work which runs as administrator and didn't have this issue. The key difference is that with this fix, the admin prompt asks you to open VSLauncher.exe, but on my work machine, it asks to open devenv.exe so VSLauncher must be OK to open VS2010 somehow. I'll ask our infrastructure guys how they did it and post back.

Related

PDB remains open after debugging (Windows 10, Visual Studio)

Our previous development systems used Windows XP and Windows 7. Debugging C++ DLLs from Visual Studio worked great.
A recent move to Windows 10 has resulted in an annoying problem. We can debug once (using F5), but the 2nd time results in a linker error:
MyProg fatal error LNK1201: error writing to program database 'MyProg.pdb'
Trying to delete the .pdb manually in Explorer while Visual Studio is still open results in the error:
The action can't be completed because the file is open in devenv.exe
It doesn't matter whether you hit a breakpoint or not. Just start debugging once results in the problem. Re-starting Visual Studio resolves the issue (in the sense that you can debug once, but then you get the problem again).
If relevant:
x86 Visual Studio 2003.NET
targeting another x86 application
x64 Windows 10 Pro v1803
After hunting around for several hours some related, but unanswered, questions were found. Following suggestions in this MSDN article, along with some debugging of my own, this solution works:
Download FreePDB, a script written by MSDN user Toni76 (thanks Toni!)
Copy this script to a local folder (say C:\Apps\FreeDPB)
Download the latest version of SysInternals tool Handle (currently v4.21)
Copy handle.exe to C:\Apps\FreeDPB
NB! From the command line, run handle /? once. This is to agree the EULA. The script will not work if you skip this step!
Open Visual Studio, then Project > Properties > Build Events > Pre-Build Event
Set Command Line to C:\Apps\FreeDPB\freepdb $(ProjectName)
Set Description to Delete lock on PDB
...and now you don't need to restart Visual Studio to debug a 2nd time!
From comments, this works with multiple versions of Visual Studio on multiple versions of Windows.
Update
A more radical solution is described here which involves replacing a core Visual Studio DLL (NatDbgDE.dll). This solution only works for Visual Studio 2003 SP1, though.
In my case it was due to "Process Explorer" program, which was open alongside with my Visual Studio(I used it to check some properties of the exe I've created). After closing it problem solved.

How to fix visual studio error "cannot find one or more components .Please re-install the application" in windows 8.1?

As Alex suggests find devenv.exe and run it . when search for devenv.exe then I found it's there . When I run this file getting error "cannot find one or more components .Please reinstall the application" .I re-installed visual studio thrice still getting same error . How to fix this error .
It's visual studio ultimate with update 3 . I don't have ISO file , file automatically downloaded by installer.It's got installed smoothly i.e. without giving any error .
Edit:
Initial question was How to create shortcut on windows 8.1 for visual studio ?
Contents :
Today I installed visual studio 2013 with windows phone SDK and Multi-device Hybrid apps on windows 8.1 .Unfortunately I am unable to find any shortcuts related to any one of the applications which are installed today .
How can I create shortcut or which file should I execute to open IDE ?
One answer would be search in search charm ,it's not there . I tried all methods that i could .
Following folders are there in windows 8.1 program files
C:\Program Files\iTunes
C:\Program Files\iPod
C:\Program Files\Windows Identity Foundation
C:\Program Files\Hyper-V
C:\Program Files\Common Files
C:\Program Files\IIS Express
C:\Program Files\Microsoft Identity Extensions
C:\Program Files\SharePoint Client Components
C:\Program Files\Microsoft SQL Server
C:\Program Files\Application Verifier
C:\Program Files\MSBuild
C:\Program Files\IIS
C:\Program Files\Microsoft Visual Studio 12.0
Many folders are there related to these apps in programfilesx86 .
Same problem for me. My solution:
Open command prompt as administrator
cd C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
devenv /resetuserdata
I had solved the same issue on VS2012 as following steps:
• Use regedit.exe
• Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio
• Delete "11.0_Config" & "11.0 node"
notice: 11.0 as your VS version
• Restart VS2012
VS env will be constructed initially.
Hope this help.
BR
Problem is with security setting .
After 2-3 hours of Googling i found many solution but none of them work then i tried these solutions .
There is one folder in your machine: "C:\ProgramData".
Don't worry if you don't see this folder, unhide all the folders, you will find it there.
I did not had the rights on "C:\ProgramData\Microsoft\VisualStudio" .
See if you have full rights on the same.
If your are not able to open this folder, This means that you do not have rights on this.
to give rights follow the steps below :
1) Right click on the folder "VisualStudio."
2) Go to Properties->Security. See if your PC name is there in the user names list,
if not , then add it.
3) Go to Advanced -> Owner -> Edit -> Other users or groups. add your PC name,
i.e add yourself as the owner of the folder and give full rights.
Which is found here Application-data-folder-error . I was unable to change security of ProgramData files then i tried this solution .
1. On the root folder, right click, select properties, select security tab.
2. Click Advanced
3. The window that pops up should show the current owner. Click "Change."
The "Select User or Group" pop up box appears.
4. In the text box, type in your current user name (you should be an admin), and hit the
"Check Names" button. Your name will be replaced with the "official" system
name (i.e.,preceded by computer name and back slash).
5. Click OK
6. The box disappears, sending you back to the Advanced Security Settings window.
7. A new tick box appears below owner, with the text "Replace owner on subcontainers and
objects" Select this tick box.
8. I also selected the tick box "Replace all child object permission entries
with inheritable permission entries from this object", but I think I had to run this twice
- once with this box ticked and once without.
9. Make sure that "everyone" appears on the Permission entries window, if not,
click add. The same box that appears in step 4 shows up again.
Type everyone, click "Check Names" and then "OK"
10. Hit apply
which is found here Permission error.
Finally it works cheers :) Hope it will help to some other .
%programfiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe should work. The VS version number (12.0) depends on your installed Visual Studio, of course.
Oh, and if you're on a 32-bit install of Windows, then use:
%programfiles%\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
I have come across this problem while installing VS 2015 community. For me the problem was that I had ThreatFire running, which prevented VS from loading some dll. Deinstalling ThreatFire was the only solution. You cannot just stop it, as the actual service will still continue to run.
In general, thats how I figured out what the problem is:
Download and extract Windows Process Monitor https://technet.microsoft.com/en-us/library/bb896645.aspx
Run Process Monitor, include Process devenv.exe to the filters, exlcude Result SUCCESS, and click ok.
Process Monitor will display a huge list of file and registry accesses. Go through the list and look for events with Result ACCESS DENIED or FILE/PATH NOT FOUND. (You can filter the list even more using right click context menu)
That should give you usefull hints about what is really going wrong as the VS error message really is no help at all. You can also view the stack trace that generated the event. Thats how I found out about ThreatFire blocking dll loading.
For Visual Studio 2015 I had to delete these keys in regedit.exe:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config
One possible user friendly workaround is to use the take ownership method from How to Geek and use it on %USERPROFILE%\AppData and on C:\ProgramData where C is the disk partition holding your OS. However you'll need to make hidden folders visible first. Then navigate to your VS installation folder and run devenv /resetuserdata.
Was facing the same issue with VSExpress 2015 (win 10).
Fixed the problem by removing the registry key in
[HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\
AppCompatFlags\Layers]
Refer the link for more details
http://maditguy72.blogspot.ru/2013/06/cannot-find-one-or-more-components.html
I had the same problem, and I have fixed it.
You should check the name of the folder in which you installed visual studio.
If its name has been changed, windows can not find the components to execute. For this reason, windows will show an error message box to you
I'm on windows 7 32bits SP1. this worked for me :
run cmd.exe with elevated privileges (run as administrator). then execute :
cd c:\program files\microsoft visual studio 15.0\common7\ide
devenv.exe /resetuserdata
devenv.exe
before that I tried to give full rights (for my user account and also the weird Account-unknown(S1-5-21-13113034....) ) to these folders: c:\program files\microsoft visual studio 14.0 and c:\users\_myname_\appdata\local\microsoft
note that when installing visual studio, I changed the default folder name to c:\program files\microsoft visual studio 2015 so maybe it is related to the bug seen later ?
I had the same problem, and it turned out to be that my password on my local admin account expired. I use a regular account to login to Windows, but run Visual Studio as Administrator. Upon opening Visual Studio as Administrator, it prompts me for my local admin credentials, and because my password had expired, it gives me this error message.
Solution: Log out of Windows. Switch users, and login as the local admin. Windows will tell you that your password has expired. Change the password, and log out. Log back in as your normal user account, and try running Visual Studio again, this time entering the new admin password.
To fix this issue
Start regedit.exe
Go to HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio
Delete 11.0_Config
Restart ssms.exe
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b6d2b85d-c6e1-464a-85e0-e0625e7fb305/microsoft-visual-studio-shell-isolated-cannot-find-one-or-more-components?forum=sqlexpress
This is probably specific to people working with Isolated Shell applications based on VS 2015, but I found that two registry values were sometimes getting set with incorrect values, leading to this error on startup. Simply delete them from the registry and start again:
HKCU\Software\Company\TheApp\1.0_Config\Initialization\PkgDefSearchPath
HKCU\Software\Company\TheApp\1.0_Config\Initialization\RelativeRootFolderPath
For Visual Studio 2015, replace Company\TheApp\1.0_Config with Microsoft\VisualStudio\14.0_Config.
Go to regedit.
Renaming HKEY_CURRENT_USER\Software\Microsoft\VisualStudio fixed problem for me.
No need to reinstall just reset devenv data…
cd c:\program files\microsoft visual studio 15.0\common7\ide
devenv.exe /resetuserdata
Run VS2013/12 with administrator rights.
It will work fine.
Visual Studio Enterprise 2017 Version 15.8.6
Run cmd as administrator, then:
cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE
devenv /resetuserdata
For users experiencing this issue who has tried all the above answers, this is what worked for me for Visual Studio 2015:
After uninstalling/reinstalling Visual Studio 2015, if you're still experencing the "Cannot find one or more components" error, open up Add or Remove Programs from the Windows search bar.
Uninstall any redistributables from 2015 and 2017 if applicable.
If you happen to have the offline install folder for Visual Studio 2015 - navigate to the "packages/vcRedistD14" folder and install both the 32 bit and 64 bit redistributable packages. Otherwise, download them from the MS website.
Attempt to open Visual Studio 2015, it should be working normally now.
I haven't attempted to reinstall the 2017 redist packages, but for the purposes of getting 2015 working again, this is what worked for me. Another option if you already have them installed, is to simply Repair the redist packages.
Running cd C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
devenv /resetuserdata using the command prompt works fine.
The only thing which everyone has missed is that you will have to reboot your PC after running the above command. I was having same error after running the command several times but was fixed after I rebooted my machine.
And of course for VS 2015 replace Microsoft Visual Studio 12.0 with Microsoft Visual Studio 14.0
restart you laptop it will be fixed.it work for me
well, it seems simple but it work like magic
input visual studio in your windows search bar then
right click on the visual studio app and
choose run as administrator
all things been equal, it should run without an itch

SSIS Script Editor throws an exception

I have SQL Server 2012, SSIS, SSDT and Visual Studio 2010. I can create a new SSIS package and add a Script Task, but if I attempt to open the Script Editor for that Script Task I get the following error:
TITLE: Microsoft Visual Studio
------------------------------
Cannot show Visual Studio 2010 Tools for Applications editor.
------------------------------
ADDITIONAL INFORMATION:
Could not load file or assembly 'Microsoft.VisualStudio.Tools.Applications.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (mscorlib)
------------------------------
BUTTONS:
OK
------------------------------
From my own investigation into this error, I found that Visual Studio Tools for Applications appears to be a part of MS Office 2007 and higher. This seemed like an odd dependency for to have, but I installed MS Office 2010 just for grins. It didn't change anything. What else should I try?
You will also get this error, if you are trying to debug a script task in VS 2010 and Run64BitRuntime is set to true. In order to debug, set it to false.
I was getting this error and nothing I came across corrected the problem until I logged off as my normal user and logged in as my local admin user. Once I logged in as an admin I could edit the script in my package. Once I logged back in as my regular user the edit script button worked for it too.
I assume it needed to register the assembly on the first launch and couldn't with my regular domain user.
I also got this same error when trying to open the Script Editor, but for a different reason. Not sure how it happened, but I had 3 copies of VSTA (different versions) installed. Once I removed all of them and re-installed SQL Server 2012, problem solved. Hope that helps.
For me the solution was:
close bids (I'm on 2008r2)
reopen
edit the script (it allowed me to edit it once after restarting bids)
delete all breakpoints
make a trivial change, such as adding a blank line
save
That solved it for me.
This worked for me without doing any kind uninstall.
My environment:
Microsoft Visual Studio 9.0 (2008)
Solution:
Go to cd "C:\program files (x86)\microsoft visual studio 9.0\common7\ide\"
Execute command vsta.exe /setup /hostid SSIS_ScriptTask. This will open VSTA with blank project. Let it open and then close it.
Execute command vsta.exe /setup /hostid SSIS_ScriptComponent. This will open VSTA with blank project. Let it open and then close it.
Open your solution/packages that contains the script task.
Click Edit button in Script task and it should open now. Just in case if it dont, I would suggest to keep the blank vsta of step 2 & 3 open and then click the Edit button in script task.
Took almost two hours and thankfully it worked for me. I did not have admin right to perform all that nasty uninstall and registry edit solutions.
Hope it helps someone!!!
Reference : http://blogs.msdn.com/b/jason_howell/archive/2010/08/18/vsta-setup-and-configuration-troubles-for-ssis-2008-and-r2-installations.aspx
Cannot show Visual Studio 2010 Tools for Applications editor.
Just follow the below solution:
Go to SQL Server Setup folder.
Inside that folder "redist".
Under that one more folder "VSTA".
Under VSTA folder "X86" and "X64"
Install the VSTA_RT30.
It works fine.
I figured out my problem this morning. When I uninstalled SQL Server 2012 (and the remnants of 2008 left behind when I upgraded last month) I also uninstalled 3 packages that were actually part of Visual Studio 2010. Had I not done this, a reinstallation of SQL Server 2012 would probably have done the trick, but instead I found new errors. When I reinstalled these 3 packages from the Visual Studio 2010 distribution media, everything started working.
The 3 packages in question were:
Microsoft SQL Server 2008 R2 Data-tier Application Project
Microsoft SQL Server 2008 R2 Data-tier Application Framework
Microsoft SQL Server 2008 R2 Transact-SQL Language Service

Visual Web Developer 2010 Intellisense Broken

My Problem
In Microsoft Visual Web Developer Express 2010, my intellisense suddenly stopped working today for my front end HTML (.aspx) files but is still working fine for code behind (.cs) files.
Along with this, when I hover over any asp control declared in my aspx pages, it says
validation(): Element 'control' is not supported.
validation(): Element 'label' is not supported.
etc...
(side note: 'control' and 'label' are lowercase in the message, instead of the proper case)
My Progress
I have been looking around for answers,
a few people suggested deleting certain files, such as the "*.ncb",
but I have not been able to find any MS files with this extention
anywhere (hidden files are visible).
I have a "Web Site", not a "Project" so within my site there are no
*.sln", *.proj, *.suo" files to delete either.
One suggestion was to "Clean" my project, but I can't find that
option anywhere.
Another person suggestion running "MS Developer command prompt" and
executing a utility called "devenv" with certain arguments. I do not
have the "MS Developer command prompt", I assume because I am using
the Express Edition. I cannot find the devenv utility in my file
system as well.
I have checked all my master pages but haven't noticed anything
weird.
I looked in the Tools > Options menu but didn't find any "intellisense" type of thing anywhere. My "Show all settings" is turned on.
I tried changing the doc type in the dropdown from XHTML 1.0 Transitional to all the other things just to see, with no luck.
My Plea to fellow .Net-ers
My website builds just fine with no errors, it's just having no intellisense on my aspx pages is driving me nuts.
Is there anything else I can try? Any thoughts appreciated. Thanks!
OK,
DevEnv is the program name for visual studio - it will be here:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" on a 64 bit OS
or
"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" on a 32 bit OS.
Right click on the icon you use to run VS and then click properties and it will tell you where this file is in the Target box.
To clean a project, right click the project in the solution explorer and then click Clean.
Visual studio command prompt will be in the start menu under:
Microsoft Visual Studio 2010 > Visual Studio Tools
There may be several version depending if you are running on a 64bit OS, Itanium, etc. You can also just run DevEnv from the Run box or ordinary command prompt.
The 32bit version can be run from the Run Box using the following (if on 64 bit, add " (x86" after "Program Files"):
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
Personally, after closing down VS and rebooting the machine to check if it was just a process crash causing it (i.e. restart from a fresh OS and VS load) - I would reset option (see here /ResetSettings (devenv.exe)).
Good luck, and please reply back mif this worked or did not so to give the thread a conclusion. :D

Debug a program that needs administrator rights under Windows 7

I'm running Visual Studio 2008 on Windows 7 64-bit. I'm logged in as administrator, and I'm running it as administrator, but the program I'm working on fails with access denied when I call a restricted API. If run the program from Explorer with "Run as Administrator" it works.
I was under the belief that Visual Studio 2008 debugs programs with whatever rights Visual Studio 2008 itself is running with. As it stands I can't debug my application due to this, and I'm at a loss as to what's going on.
This works for Visual Studio 2012.
Create a manifest file: right click on the project and select "Add New Item", select "Application Manifest File". This will add a file named app.manifest to the project.
Edit manifest file: set attribute level for tag requestedExecutionLevel to requireAdministrator.
Now your program will always require admin privileges, wherever it is executed. If launched by Visual Studio debugger, it will prompt you for restarting Visual Studio as administrator, if needed.
It's best to run Visual Studio 2008 as administrator. Moreover, it's good to change your application's manifest settings to require administrator privileges. You will be prompted by the system to elevate to system administrator each time you start your application, and when running under Visual Studio 2008 the IDE will offer you the elevation before start of debugging.
To change the setting, open project properties and go to Configuration Properties → Linker → Manifest file → UAC Execution Level.
I found the answer. It turns out that it is, in fact, a manifest issue: by default if you have a manifest you need to set the appropriate administrator privilege.
The default is asInvoker, but that doesn't work if you need elevated privileges; you instead have to set it to requireAdministrator in the manifest properties.
Run Visual Studio 2008 as administrator.
I had a case where I put in the
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
settings (described by another answer at this post)........and did not work.
I found another tip (seen below)...and unchecking that option allowed my code to work.
Try going into the project properties, and under the "debug" tab,
uncheck "enable the Visual Studio hosting process" and see if that
fixes your problem.
(from https://social.msdn.microsoft.com/Forums/vstudio/en-US/b5c4da93-5d64-442e-af28-df6d10765538/debug-as-administrator?forum=vbgeneral)
So I needed the app.manifest settings AND the "uncheck".
My testing with Windows Vista and Visual Studio 2005 showed that when you use a host process, the behavior under the debugger depends only on how you launched Visual Studio and not on the manifest (or lack of manifest) of your application. When Visual Studio is launched elevated, the behavior depends only on the use (or not) of a host process, not on the manifest. This is probably still true with Windows 7 and Visual Studio 2008.
Also, have you tried launching the application outside Visual Studio and using Attach to Process?

Resources