Failed to add service link - blocked / read-only

Whenever I go to add a link to a service, I get an error message:

Failed to add service link 'Servicereference1.reference'
Error: Unable to check the current file. The file may be read-only or locked, or you may need to check the file manually.

I already had a link to the service in the project, but it somehow broke and reported me an error:

Could not find default endpoint element that references contract (servicename)

The endpoints in both the web.config file and the service help system were the same (localhost)

I also could not update this link, since I would get the same error "failed to check the current file."

EDIT: The problem is not native to this project alone. I tried to create a new, completely separate project and add a link to the service, and I got the same error.

+43
c # wcf
Jun 10 '14 at 18:40
source share
9 answers

I had the same error: I found that there are problems if you have the Microsoft Git provider version control plugin (my WCF solution was not added to the original control!), And you are trying to add a link to the service.

  • install version control plugin on None
    • go to TOOLS> Options> Source Control.
  • add service link
  • set the control source plugin to its original value
+71
Jan 09 '15 at 9:18
source share

I know that this was answered, but before trying everything else in the answers, restart the visual studio. This happened to me and to four other people in my WCF class. It seems to be a problem with the visual studio of 2013, and not with 2012.

+25
Nov 07 '14 at 14:52
source share

As you have already cleared, source control is not involved (which, apparently, is causing the problem for me), you can try the following steps:

  • Make sure you copy the paste from the location where the source was, and then delete certain source control files.

  • Make sure the folder is not locked, and also not read-only. If so, then remove only the read from the folder.

  • Make sure the visual studio is not in debug mode when adding a link.

  • If the above does not work, close the visual studio and restart it.

  • Make sure that Visual Studio is running as "Run as administrator."

  • Finally, if all of the above does not work, try restarting your computer.

Let me know if this works or not.

+11
Jun 11 '14 at 6:35
source share

It may be a little late, but if someone has the same problem, I decided to run VS2013 as an administrator.

+6
Mar 29 '15 at
source share

Go to the Debug menu and click ( Options and Settings )

debug

Select Manage Source .

Under Current Source, ControlPlug pop-up menu, select none

none

Then click ok to save the chnages. Now you can add a link to the service.

+1
May 09 '17 at 12:17
source share

Some Visual Studio file seems to be corrupted. Try to remove the link completely, then generate the link using svcutil {http: // {service} / metadataEndpoint} (I assume it is WCF) or (use wsdl.exe for web services), then get the client proxy and put it in project use it. See if this works well.

0
Jun 10 '14 at 19:27
source share

Disabling the default source control to add a link is horrible. @ScottG said above and it works. Just run VS as an administrator - it works, and you do not need to bother with your environment. VS 2013 UP-5 still has this issue.

0
Aug 18 '15 at 0:24
source share

Check that your files are read-only, if so, remove the read-only attribute and restart visual studio and try adding a link to the service. it worked for me like that.

0
Aug 24 '15 at 19:23
source share

Make sure that your folder in IIS where your services are located (I mean the physical file; .svc) is not open or even selected in the file manager. This works for me, but before I almost went crazy to find a mistake.

0
Nov 17 '15 at 8:18
source share



All Articles