简体   繁体   English

发布应用程序时找不到指定的文件

[英]Unable to find the specified file when publishing application

I have a vb.net application which plays a mp3, but once I publish it the file cannot be found. 我有一个播放mp3的vb.net应用程序,但是一旦发布它,就找不到该文件。 I get the following error 我收到以下错误

System.IO.FileNotFoundException: Unable to find the specified file. System.IO.FileNotFoundException:无法找到指定的文件。

Public Class Form2
Public audio As New AudioFile(My.Application.Info.DirectoryPath & "\01 - Help.mp3")
Public Sub startsong(ByVal D As Data)
    Me.Show()
    MHTvalue.Text = D.mht.ToString
    Maxcallsvalue.Text = D.maxcalls
    CPHvalue.Text = D.cph
    If Form1.playsong = True Then
        audio.Play()
    End If

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    ' Me.Close()
    audio.Stop()
    Form1.waittimer = 180000
End Sub

End Class 

Any ideas? 有任何想法吗?

I'm an idiot. 我是个白痴。

I didn't have set as content in build action for the mp3 file 我没有在mp3文件的构建操作中将其设置为内容

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

相关问题 发布应用程序后找不到数据库 - Can't find the database after publishing the application 运行某些命令时遇到“系统找不到指定的文件” - Encountering “the system cannot find the file specified” when running a certain command 备份数据库时系统找不到指定的文件 - The system cannot find the file specified when backup the database 发布应用程序时,ClickOnce运行错误 - ClickOnce running an error when publishing Application Visual Studio VB应用程序安装错误:“系统找不到指定的文件。 ” - Visual Studio VB application Installation Error: “The system cannot find the file specified. ” 如何添加 excel 文件作为发布 vb.NET 应用程序的一部分 - How to add excel file be a part of publishing a vb.NET application Google API没有应用程序与此操作的指定文件相关联 - Google API No application is associated with the specified file for this operation 带有vb的psexec找不到指定的文件 - psexec with vb cannot find specified file 例外-系统找不到指定的文件 - Exception - System cannot find the file specified 错误打印:此应用程序未与指定文件关联 - Error Printing: No application is associated with the specified file for this operation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM