Service Reference Visual Studio

I recently changed my computer and I’m having trouble cloning my website repository. All my projects are on Github, and I was able to clone them without any issues, but the website can’t detect the service reference. It’s a bit strange because my colleagues (and me on my previous computer) can access the project with its service references correctly without any issues, but on this computer, it doesn’t detect them. Do you know how to fix this?

Imports Reference

I’ve tried deleting the reference and recreating it, but it didn’t work.

Problem:

You cloned your website project on a new computer, but now service references aren’t detected, even though it works for your colleagues and worked on your old PC.


Most Likely Cause:

Missing tools or SDKs on the new machine.
Service references (like WCF or Web Service references) rely on:

  • Correct .NET SDK/Framework
  • Connected Services tooling in Visual Studio
  • Possibly configuration files like .svcmap, .config, etc.

Fix (Step-by-Step):

  1. Check Visual Studio Setup:
  • Open Visual Studio Installer
  • Make sure “.NET Framework targeting pack” and “.NET desktop development” are installed
  1. Restore NuGet packages:
    Run in the solution directory:
dotnet restore
  1. Rebuild the solution:
  • This sometimes regenerates the service reference files.
  • Use Build > Clean then Build > Rebuild.
  1. Check service reference files exist:
  • Look for .svcmap, .wsdl, .xsd, and Reference.cs in the Service References folder.
  • If missing, copy them from a working machine or re-add the reference.
  1. If all else fails:
  • Delete and re-add the service reference using:
    Right-click project > Add > Service Reference

Summary:

Step Action
SDK missing Install required .NET tools via VS Installer
NuGet issues Run dotnet restore
Rebuild issue Clean + Rebuild in Visual Studio
Files missing Copy or re-add service reference