在SharePoint内部部署环境中部署SharePoint托管的应用程序时,Visual Studio不会更改主机文件

问题描述:

大家好,

我使用Visual Studio 2012构建App for SharePoint(SharePoint托管的应用程序)并部署使用visual studio到SharePoint的应用程序。  一切正常,除了hosts文件没有改变,我应该手动将app域(app-xxxxxx.apps.doman.local)
添加到主机文件。

I use Visual studio 2012 to build App for SharePoint (SharePoint-hosted App) and I deploy the apps using visual studio to SharePoint.  Everything work correctly except the hosts file don’t change and I should add app domain (app-xxxxxx.apps.doman.local) to the host file manually.

我的开发环境配置如下:

My development environment configure as following:


  • Web字体结束,应用程序服务器和SQL服务器。
  • 所有SharePoint服务都在应用程序服务器上运行。
  • 在Web服务器上安装了办公工具的VS 2012。
  • 我使用了这篇文章(http: //msdn.microsoft.com/en-us/library/fp179923.aspx)配置Web前端服务器。
  • 使用过的用户帐户是本地管理员和服务器场管理员。

任何形式的帮助都将受到高度赞赏。

Any kind of help will be highly appreciated.

必须先使用admin权限运行Visual Studio,然后才能为您更新hosts文件。在这些情况下,主机文件不会更新:

Visual Studio must be run with admin privileges before it will update the hosts file for you. The host file won’t be updated in these situations:


  1. VS未以管理员身份运行。

  2. 如果DNS可以解析名称,这意味着您不需要更新主机文件。

如果这些都不适用但是,请告诉我们。

If neither of these apply to your scenario, though, let us know.

问候,