0

Word 文書を印刷するアプリケーションがあります。私はサードパーティの GemBox ソフトウェアを使用していますが、私の開発環境ではこのコードが機能します。

public void OutputLetter(string outputFile, string placeholder, string newText)
{
    using (var document = DocX.Load(this.InputFile))
    {
        document.ReplaceText(placeholder, newText);
        document.SaveAs(outputFile);
    }

    this.PrintDocument(outputFile);
}

private void PrintDocument(string outputFile)
{
    var document = DocumentModel.Load(outputFile, LoadOptions.DocxDefault);
    document.Print(AppSettings.PrinterName);
}

AppSettings.PrinterName は、web.config に保存されているプリンターの名前です。展開すると、このエラーが表示されます。"document.Print(AppSettings.PrinterName);"

System.Printing.PrintQueueException: PrintTicket provider failed to bind to printer. Win32 error: Access is denied. 

私が得るイベントビューアで;

The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID 
{BA7C0D29-81CA-4901-B450-634E20BB8C34}
 and APPID 
{AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0}
 to the user IIS APPPOOL\Mulalley SID (S-1-5-82-1744840036-3971326342-2272496405-1389653927-2904033151) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

これを修正するにはどうすればよいですか?

4

1 に答える 1

0

これは、Microsoft bk2872151 の問題である可能性があります

彼らはユーザーに修正を提供します。開発者に推奨される解決策は、64 ビット サーバー上で 32 ビット モードで実行していないことを確認することです (つまり、AnyCPU に切り替えます)。

VS2013 では、AnyCPU を選択した場合でも、32 ビットを優先するための追加のチェック ボックスもあることに注意してください。

于 2014-03-04T09:38:52.583 に答える