リンクボタンhttp://code.google.com/p/wkhtmltopdf/wkhtmltopdfでHTMLファイルをPDFドキュメントに変換するため
に使用しています
ユーザーがリンク ボタンをクリックすると、次のコードが実行され、ファイル パスのコードが引数 ProcessStartInfo として渡されます。このコードは、次のシナリオでのみ正常に機能します
Web サイトがドメインhttp://www.xyz.net/でホストされていることを考慮する
- パスについて言及すると、
http://demo.XYZ.net/正常に動作します http://www.XYZ.net/うまくいかないのでパスに言及すると- ローカルホストの場合、パスが
http://localhost:51005/XYZ/またはhttp://web:8080/ 
PrintArticle.aspxこれが正しく機能するためには、Web サイトに完全な信頼レベルを与える必要があります。コードが実行されない理由がわかりません。サブドメインを作成する場合は put を作成する場合と同じドメイン パスを指定すると、正常に動作します。これがセキュリティ上の問題なのか、それとも何なのかわかりません
以下のコード
protected void lnkbtnDownload_Click(object sender, EventArgs e)
{
    //ConvertURLToPDF();
    try
    {
        string url = "PrintArticle.aspx?articleID=" + Request["articleID"] + "&download=yes&Language=" + Request["Language"];
        //string args = string.Format("\"{0}\" - ", "http://demo.XYZ.net/" + url); //Works
        //string args = string.Format("\"{0}\" - ", "http://www.xyz.net/" + url); Doesnt work
        //string args = string.Format("\"{0}\" - ", url);
        string args = string.Format("\"{0}\" - ", "http://localhost:51005/XYZ/" + url); //Works
        var startInfo = new ProcessStartInfo(Server.MapPath("bin\\wkhtmltopdf.exe"), args)
        {
            UseShellExecute = false,
            CreateNoWindow = true,
            RedirectStandardOutput = true
        };
        var proc = new Process { StartInfo = startInfo };
        proc.Start();
        string output = proc.StandardOutput.ReadToEnd();
        byte[] buffer = proc.StandardOutput.CurrentEncoding.GetBytes(output);
        proc.WaitForExit();
        proc.Close();
        Response.ContentType = "application/pdf";
        Response.AddHeader("Content-Disposition", "attachment;filename=download.pdf");
        Response.BinaryWrite(buffer);
        Response.End();
    }
    catch (Exception ex)
    {
        throw ex;
    }
}
ファイルが同じドメインにある場合のエラー メッセージ
「/」アプリケーションでサーバー エラーが発生しました。リソースが見つかりません。
説明: HTTP 404。探しているリソース (またはその依存関係の 1 つ) は、削除されたか、名前が変更されたか、一時的に利用できない可能性があります。次の URL を見直して、スペルが正しいことを確認してください。要求された URL: /PrintArticle.aspx
バージョン情報: Microsoft .NET Framework バージョン:4.0.30319; ASP.NET バージョン:4.0.30319.272