我有以下操作方法:
public ActionResult Index(string filename)
{
string detailFolder = SSOSettingsFileManager.SSOSettingsFileReader.ReadString("bts.go.core", "SupportNotificationDetailPath");
string pathFile = System.IO.Path.Combine(detailFolder, filename);
XDocument xdoc = XDocument.Load(pathFile);
XNamespace ns = "http://BTS.GO.Core.Schemas.SupportNotificationDetail";
var notificationMsg = from x in xdoc.Descendants("NotificationMessage") select x.Value;
var content = HttpUtility.HtmlDecode(notificationMsg.FirstOrDefault());
IHtmlString htmlContent = new HtmlString(content);
SupportNotificationDetailViewModel vm = new SupportNotificationDetailViewModel();
vm.Content = htmlContent;
return View(vm);
}
将其部署到我的开发机中后,效果很好。该视图调用该动作,并返回“ NotificationMessage”元素的文本内容,该元素在屏幕上呈现,如下所示:
我的问题是,将相同的站点部署到我的测试服务器。当我单击执行操作的链接时,而不是显示文本时,我得到了包含在变量detailFolder中的文件夹内容的目录列表,如下所示:
我想这一定要归因于IIS配置的不同。我尝试使用msdn link来解决问题,但是没有运气。 msdeploy的命令返回“当文件已存在时无法创建文件”。我发现这很奇怪,因为我使用Web部署将网站部署到两个服务器。两台机器都在运行服务器2012r2
错误的服务器已安装以下Windows功能(是否需要这些?):
有什么想法吗?