Reputation: 5855
What is the difference between adding an existing image (.png) as a resource and simply adding the file to the solution? Which is to be preferred, in general and especially as a button content?
Upvotes: 1
Views: 372
Reputation: 25623
A build action of 'Resource' embeds the image in your assembly so that it doesn't need to be shipped as a loose file with your application. A build action of 'Content' adds the image to the manifest so the application knows about it and expects it to be present, but doesn't embed the image--you need to deploy the file separately, and the application will search for it at runtime. Both resources and content can be referenced with relative and absolute pack:
URIs.
A build action of 'None' does nothing. If you include the file with your application, you won't be able to reference it with a pack:
URI unless you use the absolute URI form with a siteoforigin:,,,
authority. It's best not to do this, especially since the behavior changes when your application is deployed with ClickOnce.
Upvotes: 2