4

I have a project which was originally written in VS2008 (professional). I have created a vs2010 solution (using VS2010 professional) from the projects within the VS2008 solution but am not able to add a service reference from the domain layer of the solution (a class library project). I've checked that the domain layer project is targeting framework 3.5 or 4.0, and have tried repairing and even re-installing VS2010 but still cannot add a service reference.

The "service reference" option is missing when I right click the project. There was also an existing "Web Service" reference which now fails when called during unit testing.

Has any one else experienced this problem ?

  • 1
    "add a service reference to the domain layer of the solution (a class library project)" - service references are not for referencing other projects in the same solution, or assemblies. Also, the "Add Service Reference" option is supposed to show when you right-click the References item, not the project. – bzlm Jun 12 '11 at 17:29
  • you may need to re-think what your saying. The service reference is not referencing another project in the solution it is trying to reference an external resource hosted in an IIS environment. Also, The "Service Reference" option DOES normally show when right clicking a a project within Visual Studio - i would be happy to provide a screenshot –  Jun 12 '11 at 18:34
  • It would be interesting to know if your problem is limited to your project or not. If you create a completely new C# Console Application does the Add Service Reference command appear in the project's context menu when you right click on it? – Frank Boyne Jun 12 '11 at 20:16
  • Also Web Service References are a .NET 2.0 feature now replaced by Service References see [here](http://msdn.microsoft.com/en-us/library/bb628649(v=VS.100).aspx). – Frank Boyne Jun 12 '11 at 20:18
  • @user394, see how much difference a "from" and a "to" can make. :) Thanks for clarifying. If you create a brand new solution/project, does the problem still apply like it does for [Goldy](http://stackoverflow.com/questions/6323399/vs2010-unable-to-add-service-reference/6326583#6326583)? It could be that somehow VS doesn't realize that this project targets 3.5 or higher. – bzlm Jun 13 '11 at 08:20
  • yes, the problem still applies if a create a brand new solution/project. –  Jun 13 '11 at 08:54
  • 1
    @user394721 - Not sure if you got this resolved. I had the same [problem](http://stackoverflow.com/questions/6741123/vs2010-add-service-reference-missing-unable-to-add-service-reference) and [opened a ticket with MS](https://connect.microsoft.com/VisualStudio/feedback/details/679994/visual-studio-professional-on-windows-7-ultimate-add-service-reference-missing). – Jim D'Angelo Jul 20 '11 at 13:32
  • Hi James, your work-around solved the issue - I hope MS release a fix for this ! –  Aug 19 '11 at 20:20

3 Answers3

1

For Visual Studio 10 in Windows 8. The "Add Service Reference" does not shown for 3.5 Framework or Earlier. You have to change the .NET Framework of Project to 4.0

DASH
  • 297
  • 1
  • 4
  • 10
  • Looks like problem with windows 8. Same project works fine in windows 7 on one machine giving this problem where we have windows 8 – Kamran Shahid Mar 25 '15 at 07:02
1

Check your project and make sure it is referencing framework 3.5 or higher.

  1. View the project properties.
  2. Go to Compile Tab
  3. Click the Advanced Compile Options button
  4. Look at the Target Framework combobox.
  5. Change it to 3.5 or 4.
  6. Click OK to close dialogs
  7. Right click on project now.
vbjay
  • 107
  • 10
0

Changing the Target framework to 3.5 enabled the option for me.

Rauld
  • 980
  • 2
  • 10
  • 19