Distribute images with C# Setup project
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).
精彩评论