c# - C#代码同一行上的ASPX网站错误

标签 c# asp.net iis error-handling

我有一个ASPX网站,该网站可以抓取屏幕截图并将其返回给我。该站点可以在Dev服务器上运行,但是当移动到Prod时,无论如何(即使是空白),我都会在同一行上收到错误消息。这是我的错误:
enter image description here

这是我用来发出API请求的代码。我将html中的图片网址设置为下载的文件位置。在我迁移到Prod之前,它一直对我有用。开发服务器和生产服务器具有相同的配置,并且所有代码都已更改以反射(reflect)迁移。

protected void Screen_Shot()
    {
        string input = TextBox1.Text;
        using (var client = new WebClient())
        {
            string filename = @"C:\Screen_Shot.jpg";
            string destination = @"http://api.screenshotmachine.com/?key=111111&size=N&url=" + input;
            try{

                client.DownloadFile(destination, filename);
                Image1.Visible = true;
            }
            catch(Exception)
            {
                Image1.Visible = true;
                Image1.ImageUrl = @"C:\Windows\Temp\screenshot_error.jpg";
            }
        }
    }

最佳答案

我能够通过清洗解决方案然后重新构建来清除错误。谢谢大家的帮助。

关于c# - C#代码同一行上的ASPX网站错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39492614/

相关文章:

c# - "SmtpFailedRecipientException: Mailbox unavailable"邮箱可用时

c# - 如何使用jquery进行更多控制?

javascript - 使用 javascript 验证号码

web-services - Web 服务调用导致 System.Xml.XmlException : '.' , 十六进制值 0x00

windows - 如何在 IIS 上设置 Mercurial 和 hgweb?

c# - 连字符后的字符影响 string.compare

c# - 有没有更好的方法来覆盖文件然后检查更改(在 C# 中)?

c# - 验证 datetime fluent nhibernate 映射

ASP.NET:Response.AppendHeader,位置 301 永久移动,使用自定义 header 发送

security - IIS7 - 如何使用 Web.config 文件密码保护单个文件夹?