Visual C# - 发布时包含资源文件 [英] Visual C# - Including Resource Files when Publishing

查看:233
本文介绍了Visual C# - 发布时包含资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如果在我的项目中实际包含额外的资源文件,我有点迷失...


我有一个.pdf文件我希望最终用户能够作为帮助文件进行访问,一切正常,除非我去发布它,应用程序试图在我从中获取它的原始目录中找到它。我看到有几个属性选项供我使用,但我不确定他们做了什么 - ''构建动作''和''复制到输出目录''


可能有人请指出我正确的方向,如何将这样的独立文件包含到项目中,以便在发布和分发时文件是应用程序的一部分?


非常感谢,


Ben

解决方案

您正在开发Web应用程序或桌面应用程序吗?


< blockquote>

这是桌面应用。

谢谢=)


你需要使用 ResourceManager ,用于检索嵌入资源。


您目前正在这样做吗?


Hi,

I''m a bit lost as to how to actually include additional resource files in my project...

I have a .pdf file I would like the end user to be able to access as a help file, it all works ok, except when I go and publish it the application tries to find it in the original directory that I got it from. I see there are several property options available to me but I''m not sure what they do - ''Build Action'' and ''Copy to Output Directory''

Could someone please point me in the right direction on how to include stand-alone files like this into a project so that when it gets published and distributed the file is part of the application?

Many Thanks,

Ben

解决方案

Are you developing a web application or desktop application?


Hi,
It''s a desktop app.
Thanks =)


You need to use a ResourceManager to retrieve embedded resources.

Are you currently doing so?


这篇关于Visual C# - 发布时包含资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆