Answered by:
Click once application to connect to remote server

Question
-
User1282865739 posted
I have a .net application which calls a webservice deployed on my local windows server 2012 on IIS, and the sql server database resides on that server too. All employees connect to the same service and DB since we're all on the same domain, and I publish the app and webservice to the server through visual studio (2012).
Now I need to make employees access this application when they are outside the company's network, so I deployed the webservice on IIS on one of our remote windows 2012 servers, I created a public shared folder in my remote server and added to app webservice files to it and in visual studio I changed the publish method to web deploy and filled in the information as below:
Server: https://x.x.x.x/
Site Name: https://x.x.x.x/PublicFolder
Destication URL: https://x.x.x.x/PublicFolder/Application
When I click Validate Connection, it fails with the following message:
Could not connect to the remote computer ("x.x.x.x"). on the remote computer make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE. Unable to connect to the remote server
Note that I tried to replace https with http and I got another error:
Could not connect to the remote computer ("x.x.x.x"). on the remote computer make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN. the remote server returned an error: (401)Unauthorized
I went to the previous link and I did what they suggested:
Create a separate user group MSDepSvcUsers on remote computer.
Create an local account A on both local & remote computer.
Add A to MSDepSvcUsers on remote computer.
Use account A to publish, this will allow you to publish without needing to use built-in admin account.Then I found another possible solution:
Add/modify windows registery key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\” and set it “1”.
After I added this registry key, the error changed to:
site 'http:' does not exist ... #ERROR_SITE_DOES_NOT_EXIST
So now if I put wrong credentials, I get the unauthorized error, if I use correct credentials I get side does not exist error.
What should I do?
Monday, January 16, 2017 7:51 AM
Answers
-
User1282865739 posted
Yuk, it worked!!
I mean the connection, it's now validated, all I had to do is change site name from "http://x.x.x.x/PublicFolder" to "Default Web Site\SiteName"!!
This is really confusing, finally got it!
- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Monday, January 16, 2017 10:27 AM
All replies
-
User-460007017 posted
Hi saleem_deek,
I think the registry key is not the problem. Does your logon user has the write permission of the remote server?
Best Regards,
Yuk Ding
Monday, January 16, 2017 9:25 AM -
User1282865739 posted
Hi Yuk,
You mean the user I am using to logon to server over RDP? yes, actually I'm logging in using Administrator, I also tried using another user I created on the remote server (which I added to the administrators group too) but still the same errors, wrong credentials I get NOT_ADMIN error, correct credentials I get sit dose not exist error
Monday, January 16, 2017 9:55 AM -
User1282865739 posted
Yuk, it worked!!
I mean the connection, it's now validated, all I had to do is change site name from "http://x.x.x.x/PublicFolder" to "Default Web Site\SiteName"!!
This is really confusing, finally got it!
- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Monday, January 16, 2017 10:27 AM