简体   繁体   English

错误打印:此应用程序未与指定文件关联

[英]Error Printing: No application is associated with the specified file for this operation

I have a VB WinForms app that prints PDFs using Process.Start, and it has been working fine for ages on Windows 10. Today I go to use it and get the following error message: 我有一个VB WinForms应用程序,该应用程序使用Process.Start打印PDF,并且在Windows 10上已经运行了很长时间。今天,我去使用它并得到以下错误消息:

"No application is associated with the specified file for this operation" “没有应用程序与此操作指定的文件关联”

Nothing has changed to cause this, I have not changed PDF Viewer or uninstalled anything. 没有任何改变导致此,我没有改变PDF Viewer或卸载了任何东西。 I can open a PDF by double clicking on it no problems. 我可以双击打开PDF,没有问题。

I wrote a small console app to replicate the issue and prove this had nothing to do with the WinForms app: 我编写了一个小型控制台应用程序来复制问题,并证明这与WinForms应用程序无关:

Sub Main()
    Dim pi As New Diagnostics.ProcessStartInfo
    Dim url As String = "C:\PathToPDF\.pdf"
    pi.FileName = url
    pi.Verb = "PrintTo"
    pi.CreateNoWindow = True
    pi.Arguments = """Microsoft Print to PDF"""
    pi.UseShellExecute = True

    Console.WriteLine(url)

    Diagnostics.Process.Start(pi)

    Console.ReadKey()
End Sub

The above program replicates the error. 上面的程序复制了错误。 I have verified that the file exists and is accessible and tried it with double slashes and single slashes, they give the same error: 我已经验证了该文件存在并且可以访问,并使用双斜杠和单斜杠对其进行了尝试,它们给出了相同的错误:

"No application is associated with the specified file for this operation". “没有应用程序与此操作指定的文件关联”。

The same application is working fine on other PCs in the office. 相同的应用程序在办公室的其他PC上运行正常。 Has anyone else had this happen, and if so how did they fix it? 有没有其他人发生过这种情况,如果是这样,他们如何解决? My PDF viewer is PDFXChange Viewer, and it has been working fine PDFs printed using this method for years. 我的PDF查看器是PDFXChange Viewer,并且使用这种方法打印的PDF多年来一直可以正常工作。 I have not updated the program, and it says in the about page that the last installed updated was in 2016. 我尚未更新程序,它在“关于”页面中表示上次安装的更新是在2016年。

Regards. 问候。

If I am right, I had the same issue. 如果我是对的,我也有同样的问题。 Maybe you can try it in a slightly other way. 也许您可以以其他方式尝试。 I have this in my application and it works fine: 我在我的应用程序中有它,它工作正常:

    Dim myp As New Process
    myp.StartInfo.FileName = filename 'Full path to pdf
    myp.Start()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google API没有应用程序与此操作的指定文件相关联 - Google API No application is associated with the specified file for this operation 没有应用程序与此操作的指定文件关联(VB.NET) - No application is associated with the specified file for this operation (VB.NET) 从 vb.net 执行 AutoIt 脚本时,没有应用程序与此操作的指定文件关联 - Getting No application is associated with the specified file for this operation while executing AutoIt scripts from vb.net Sync Framework 2.0错误:不支持指定的更改跟踪操作 - Sync Framework 2.0 Error: The specified change tracking operation is not supported Visual Studio VB应用程序安装错误:“系统找不到指定的文件。 ” - Visual Studio VB application Installation Error: “The system cannot find the file specified. ” 发布应用程序时找不到指定的文件 - Unable to find the specified file when publishing application 使用word.application打印导致错误“有打印机错误” - Printing with word.application causes error “There is a printer error” NReco错误:“指定的可执行文件不是此OS平台的有效应用程序” - NReco Error: “The specified executable is not a valid application for this OS platform” 如何检测关联类型的文件是否已启动我的应用程序? vb.net - How can I detect if a file of associated type has started my application? vb.net Azure 中“/”应用程序中的服务器错误(错误:26 - 定位指定服务器/实例时出错) - Server Error in '/' Application (error: 26 - Error Locating Server/Instance Specified) in Azure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM