This post is about a problem that I have had recently with visual studio .Net 2008, WCF and Windows 7.
I have a working WCF service (add to the solution by another person) which I am trying to run from within my visual studio 2008. Normally, you should go to your project, right click on it and click on add service reference. You should then search for services within the solution and add the WCF service which is in the same solution. This will even work if it is in a different solution as long as the WCF service is in a Visual Studio solution that is currently open.
When I try to search for this service and add it, I got timeout error, error downloading service information and if I try to run the service itself by navigating to it from Visual studio, the wcfservice.svc file itself does not open. It comes out with could not find host, page cannot be displayed and timeout errors.
After spending sometime trying to find out what is causing it, I found out that I have miraculously forgot to run Visual studio 2008 as Administrator. Basically, when you want to run visual studio 2008, you need to right click on its shortcut icon (in the task bar in windows 7) and click on Run As Administrator. This way, you will be running Visual studio as an administrator. Even if you are an administrator on the machine, you will not be running visual studio as admin if you just click on it to open.
I know this issue sounds simple and not a lot of people will have that but, I believe the post might be helpful to someone. I can’t recall having this problem on Windows server 2003, windows server 2008, windows vista or even winsows XP! It’s only happening on this development machine which was built for me using Windows 7.
If you want to stop having to right click on the shortcut icon and click on run as administrator everytime, there is a simple way to make an application to run as administrator by default permanently. Go to visual studio .net shortcut on the start menu (or the other application that you want it to always run as administrator), right click on the visual studio application icon, and click on properties. In the application properties, click on compatibility tab and then check the privilege level option that says “Run this program as administrator”.
This should get you to always run visual studio or any other application always as an administrator.
Please comment if you found this post useful.