C# Visual Studio 2010 Ultimate 在 ClickOnce 部署中包含 html 文件
我有一个在 VS 2010 Ultimate 中创建的 C# 程序。我添加了 .html 文件用作帮助文件。帮助文件位于与项目文件相同的目录中。有谁知道使用 ClickOnce 部署后当前目录的路径是什么?我尝试过的一切都不起作用。我还将 .html 文件放在与项目文件相同的目录中,但这也不起作用。 (我已在项目属性中添加了 .html 文件)
I have a C# program created in VS 2010 ultimate. I have added .html files to be used as help files. The help files are in a directory in the same directory as the project file. Does anyone know what the path would be from current directory after deployment with ClickOnce? Nothing I have tried has worked. I have also put the .html files in the same directory as project file but that doesn't work either. (I have added the .html files in project properties)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在解决方案资源管理器中,右键单击
x.html
文件并选择Properties
。在属性中,将复制到输出目录
设置为始终复制
。在您的代码中使用以下代码引用您的 x.html 文件:
In the Solution Explorer, right click on your
x.html
file and selectProperties
. In the properties setCopy to Output Directory
setting toCopy always
.In your code reference your x.html file using this code:
您是否尝试过将 .HTML 文件添加到您的项目本身?然后,在项目内部将“复制到输出目录”设置为
True
?Have you tried adding the .HTML files to your project itself? Then, inside the project set 'Copy To Output Directory' to
True
?转到文件的属性并确保
复制到输出
为true
。然后,您应该能够像这样访问它们:Go to the properties of the files and make sure
Copy to Output
istrue
. And then, you should be able to access them like this: