我在IIS上创建并托管了我的ASP.net MVC应用程序。 在其中一个视图中,需要在单击按钮时打开ClickOnce应用程序(WPF MVVM)。
这是我在View中的代码:
<tr>
<td>
<button type="button" onclick="location.href='@Url.Action("ClickOnce", "Home")'"> </button>
<td>
<tr>
我的C#代码:
public ActionResult ClickOnce()
{
string file_path = string.Empty;
file_path = ConfigurationManager.AppSettings["ClickOncePath"].ToString();
string content = "application/x-ms-application";
return new FilePathResult(file_path, content);
}
但是按钮点击我收到此错误: -
激活http://localhost/MyPortal/Home/ClickOnce导致异常。检测到以下失败消息: +来自http://localhost/EBuroMig10Portal/Error/Index的异常读取清单:清单可能无效或无法打开文件。 此XML文档中禁止使用+ DTD。
请分享一些输入如何在按钮Click上启动ClickOnce。