Reputation: 535
I have images in View/Images folder of my class library. I tried to set their Build action to Resources and Embedded Resources but they are not packed to class library dll. How can I do this?
Upvotes: 0
Views: 1737
Reputation: 11
As Reza mentioned,set the Build action to Embedded Resource for all the images.I have used the following code snippet to check whether the images are loaded into the DLL or not.I am able to get all the images
protected void btnGetImages_Click(object sender, EventArgs e)
{
Assembly currentAssembly = Assembly.GetExecutingAssembly();
string[] resources = currentAssembly.GetManifestResourceNames();
foreach(string resource in resources)
{
Response.Write(resource + "<br/>");
}
}
Upvotes: 0