How To Fix "There was a problem sending the command to the program." in Visual Studio

by Updated July 22, 2010

While using my new Windows 7 64-bit computer, with Visual Studio 2010 running as Administrator,  I began getting the following error while trying to open up individual c# files or asp.net files in VS2010: "There was a problem sending the command to the program."   I would get this error whether I was trying to open files with Visual Studio 2008 or Visual Studio 2010. 

Essentially, to get around this error in Windows 7, you will want to turn off or uncheck "Run this program as an administrator" within the Compatibility tab for Visual Studio 2010 (or 2008).  To do this: 

  1. Right-click on Visual Studio application or shortcut
  2. Click Properties and then click the Compatibility tab.
  3. Unchecked "Run this program as an administrator" and click OK.

If you still want to open Visual Studio automatically as Administrator so you can run a project with IIS7 support, you can actually set certain shortcuts to open Visual Studio as Administrator. This means that unless you use your prefered short-cut, Visual Studio will not open as Administrator when Visual Studio is run, so you won't have to deal with the "problem sending the command to the program" error on most occasions.  See how to do this below in step 2:

VS version is actually irrelevant to the error, I believe.  I get it in VS2008 and it's more of an issue with Windows 7 security than VS itself.

1. There is a specific application installed on the system when you have more than one version of VS installed on a machine called "Visual Studio Version Selector" (VSLauncher.exe - http://processlist.com/info/vslauncher-2.html).
VS2010 is probably set to always run with Admin privledges (right-click exe and go to properties, within the compatibility tab there's a "Run as Administrator" checkbox).  If so, then VSLauncer.exe must also run with administrative privledges or else you're running into security issues.  As an attempt at explaining:
You double click a file, Windows recognizes that this needs to be run with VSLauncer, VSLauncher runs with user-level permissions, VSLauncher tells VS2010 to load the file with regular user-level permissions, VS2010 wants admin privledges... Uh oh.

2.  My prefered solution.  Disable "Run as Administrator" from the Compatibility tab within the properties on the executable for VS2010.  Create a shortcut on your desktop or menu (whatever) that you can use to boot this with elevated permissions.  On the shortcut right-click and go to Properties.  Within the Shortcut tab, click Advanced to bring up a new dialog box.  In this dialog box there is an option to run the shortcut itself under Administrative permissions.

The second solution above is definitely my new prefered solution/ workaround to fix this Visual Studio / Windows 7 error "There was a problem sending the command to the program."   Thanks to Bill Blum and his post here.

Also see: How to Run Visual Studio.NET Automatically as an Administrator

 


0
6

6 Comments

anonymous by Andy on 7/20/2010
I think that is more like a workaround than a solution. Why in the heck do elevated permissions matter on a developer machine anyway? Why would Windows need to prevent a user with administrative rights from opening a code file in administrator context? Bah.
anonymous by Michael on 4/27/2011
This was a helpful article. Thanks!!
anonymous by it'snotworking on 6/14/2011
Your workaround is not working, maybe it helped for your case but not for the other 23 pc's I had it on.
Never write: How to fix... if you're not sure if it's the solution for all cases.
Anyhow, google a bit about Dynamic Data exchange and this error message and you'll find the solution for your environment, because it depends on the applications installed on a pc and the solution varies a bit. But those are the keywords (DDE + Error line)
anonymous by Chesare on 11/23/2011
Great article and great help. Thank you!
anonymous by Isabella Soprano on 6/27/2012
Hmmm.Even i faced the same issue.But SP2010 projects require run as admin.The workaround is good.
anonymous by Caioym on 9/27/2012
Perfect solution that number 2. Thanks

Add your comment

by Anonymous - Already have an account? Login now!
Your Name:  

Comment:  
Enter the text you see in the image below
What do you see?
Can't read the image? View a new one.
Your comment will appear after being approved.

Related Posts


When developing websites or applications in Visual Studio.NET, you sometimes need to have Visual Studio run as an administrator. For instance, if you are developing a Web Application Project that uses IIS7 as the local development server for testing,...  more »

Recently, I decided to begin converting my Visual Studio.net Web Site Projects (WSP) to Web Application Projects (WAP) to take advantage of some of the new Web Deployment features in Visual Studio.net 2010 (see Vishal Joshi's blog for a run through of WSP...  more »

So yesterday, I started getting green squiggly line validation warnings at design time on ASP.NET server controls within the HTML Design view for my Visual Web Developer 2010 Express project in Windows 7. Essentially, intellisense on all the ASP.NET...  more »

The default settings in Visual Studio 2010 Professional do not automatically show the Solution file by default in the Solution Explorer sidebar. This can be a bit of a problem if you are trying to add another project to your existing solution. To get the...  more »