C# System.Diagnostics.Process.Start导致错误“;没有应用程序与此操作的指定文件关联;部署时
我是c#新手,使用ASP.NET 4.7.2和Visual Studio 2019创建了一个web表单。我的一个按钮使用以下链接到url:C# System.Diagnostics.Process.Start导致错误“;没有应用程序与此操作的指定文件关联;部署时,c#,asp.net,url,webforms,system.diagnostics,C#,Asp.net,Url,Webforms,System.diagnostics,我是c#新手,使用ASP.NET 4.7.2和Visual Studio 2019创建了一个web表单。我的一个按钮使用以下链接到url: System.Diagnostics.Process.Start("www.google.com", "_blank"); 然而,当我在本地调试我的应用程序时,它运行良好。部署应用程序并单击同一按钮后,将显示以下错误: Exception Details: System.ComponentModel.Win32Exception: No applicati
System.Diagnostics.Process.Start("www.google.com", "_blank");
然而,当我在本地调试我的应用程序时,它运行良好。部署应用程序并单击同一按钮后,将显示以下错误:
Exception Details: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation
这直接指向调用System.Diagnostics.Process.Start
的行
我做错了什么?这有帮助吗?我不确定我做对了。在我看来,您链接的问题建议我将一个空字符串传递给Process.Start。。。但是这将如何打开url?这意味着没有标准的过程来打开机器上的链接,或者我已经编辑了我的评论!但是机器可以打开那个url。。。它在部署时不起作用