How to publish a Webservice using Visual Studio C#?

Asked

Viewed 479 times

1

I’m trying to publish a Webservice with Visual Studio but the connection is failing. Someone can help me connect on this project?

Here’s the error message from 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. Cannot create Folder 'bin'. Acces denied.
2>Publish failed. Target file://C:/Inetpub/wwwroot/meuWebservice.
2> ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ============ ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

What am I doing wrong?

  • Welcome to Stackoverflowpt, Please Translate your Question into English.

  • Izabel, I translated your question into Portuguese. I hope I didn’t get lost in the translation. And it will also be much more useful to the Portuguese-speaking community

  • try running vs as administrator

1 answer

3


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

If it does not work, you will need to give write permission in the directory of the IIS you are publishing. Open the directory, go to Estates > Security > Edit > Give the desired permission, more details:

https://technet.microsoft.com/pt-br/library/cc754344(v=Ws.11). aspx

Still another solution would be to publish in another place where you have permission. Remember to swap the mapping of the physical path of the IIS post to that folder.

  • Thank you!! It worked!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.