0

I need to publish an application built by C# on VS 2010 (.NET 4.0) to a Windows server 2008 R2.

I just followed the instructions ("publish to a file share or path") here:

https://msdn.microsoft.com/en-us/library/31kztyey.aspx

But I receive an error:

Error 158 :  VS 2010 publish application Failed to connect to "\\myServer\e$\myPath\" with the following error: 

Unable to create the Web site "\\myServer\e$\myPath\"

The path does not exist or you do not have access. The specified path is invalid. 

I can log in remotely to the "myServer". So why do I have an access problem here ?

Here "e$" is E drive on the server.

Mathemats
  • 1,185
  • 4
  • 22
  • 35
user3601704
  • 753
  • 1
  • 14
  • 46
  • If you open ``\\myServer\e$\myPath\`` in Windows Explorer, does it work? – DavidG Jun 04 '15 at 22:35
  • @DavidG, I cannot opne the "\\myServer\e$\myPath\" in Windows Explorer. But, I can access "\\myServer\" and saw the network drives on the server. If I tried "\\myServer\e$\, I was asked to type in user naem and passwrod. After typing them, I can log in to e drive and subfolders. Then, back to the VS2010 publish wizard, I can do the publishing. But, I cannot tell the application users my user name and password. I just need to give them a RUL and then they can access the application and download the software and install it. Thanks ! – user3601704 Jun 05 '15 at 00:33
  • You might have to run VS as an administrator. Mapping the path as a network drive might also do the trick. – HaukurHaf Jun 05 '15 at 00:33

1 Answers1

1

When you access the path on another server using the administrative share (i.e. e$), you need to have the correct level of permissions or it will not work. This is shown by browsing to that location in Windows Explorer - it pops up a login prompt. After you enter your details, your session now caches those credentials and the publishing wizard will also work.

Users shouldn't be accessing that application using the share path you use. Instead, the web server on that box (IIS I would assume) should have it's own binding set up. For example, you may be able to give your users an address something like this:

http://myServer/
DavidG
  • 113,891
  • 12
  • 217
  • 223
  • I need to set up a URL binding like http://myServer/myPath/myApp without using "$", right ? This needs to be set up in web publish profile ? thanks – user3601704 Jun 05 '15 at 13:08
  • No, that needs to be set up in IIS – DavidG Jun 05 '15 at 13:09
  • I am new to IIS, Would you please recommand some websites or docs that may help me with this ? Also, I found that even though I can publish the webpage but when I visit the URL and the published webpage is different from the last version (but I do not change anything of the page layout !). Also, when I clicked the "install" button on the webpage, I got en error. The details can be found here: http://stackoverflow.com/questions/30657744/error-of-downloading-an-application-published-by-vs2010. Any help would be appreciated. – user3601704 Jun 05 '15 at 15:33
  • IIS will server your website from a folder on that machine. I'm guessing the path that is set up is ``E:\myPath\`` (for example) as that matches the publish destination. If you don't know how to set up IIS, that is a completely different question I'm afraid, but more likely on another site. – DavidG Jun 05 '15 at 15:35