How to publish a WebService using Visual Studio C #?

1

I'm trying to publish a Webservice with Visual Studio but the connection is failing. Can anyone help me connect to this project?

Here is the error message when I try to publish:

  

Publishing folder / ...
  2> Unable to add 'Web.config' to the Web site. Unable to add file 'Web.config'. Acces denied ..
  2> Unable to add 'WebService1.asmx' to the Web site. Unable to add file 'WebService1.asmx'. Acces denied.   2> Unable to add folder 'bin' to the Web site. Can not create folder 'bin'. Acces denied.   2> Publish failed. Target file: /// C: / inetpub / wwwroot / myWebservice.
  2 >   ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========   ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

What am I doing wrong?

    
asked by anonymous 25.09.2017 / 03:28

1 answer

3

This occurs when you do not have permission to publish to the root directory of the application (wwwroot). Try running Visual Studio as an administrator.

If it does not work, you will need to give write permission on the IIS directory you are publishing. Open the directory by going to Properties > Security > Edit > Give the requested permission, more details:

link

Yet another solution would be to publish to another location where you have permission. Remember to change the physical path mapping of the publication in IIS to this folder.

    
25.09.2017 / 04:05