开发者

Distribute images with C# Setup project

开发者 https://www.devze.com 2022-12-20 22:02 出处:网络
I have a C# project that uses images for logo, and other purposes. The files are on my local system and when I create a set up project and run on a client machine, I get an errr that says \"System.Arg

I have a C# project that uses images for logo, and other purposes. The files are on my local system and when I create a set up project and run on a client machine, I get an errr that says "System.Argumen开发者_开发知识库tException: Parameter is not valid. at System.Drawing.Bitmap..ctor(String filename)"

If I have to distribute the image along with the project, how do I specify the path to it ?

Thanks


You could make the images embedded resources


If the images are in your project, you can set their Build Action to Content, and then in your setup project add the code project's Content Files (via Project -> Add -> Project Output, then select Content Files).

You would need to ensure that the relative path between your app and the images is the same during development and as deployed by the installer (or write code to handle the difference).

0

精彩评论

暂无评论...
验证码 换一张
取 消