Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9138477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:15:42+00:00 2026-06-17T09:15:42+00:00

I have a WPF Application project directory like this Actually i have added a

  • 0

I have a WPF Application project directory like this

enter image description here

Actually i have added a Folder named “Resources” inside Visual studio project and added some images into that.Physically the folder was created at above location.We can see that at above picture.Default properties of images inside “Resource”folder are given below

BuilAction:Resource
Copy output Directory:Do not Copy 

I am reading an image called “form1.ico” file from this folder like this

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="MyApp.FrmMain"
    Title="MyApp" Height="768" Width="1024" WindowStartupLocation="CenterScreen" x:Name="MainWindow" WindowStyle="None" Loaded="MainWindow_Loaded" ShowInTaskbar="False" ResizeMode="NoResize" WindowState="Maximized" mc:Ignorable="d" Icon="/MyApp;component/Resources/form1.ico" StateChanged="Window_StateChanged">

Every think work fine, if i run the application using Visual Studio 2008.But the Resource file is not created inside the Bin folder.My problem is if i copy the bin folder from this location to another location an run the exe which is created at bin the application get crashed(it seems it is searching absolute path of image)this is happen also if i move the Resource folder to another location.I have Tried to set properties of Images like this

BuilAction:Content
Copy output Directory:copy always

Now it is creating a Folder name “Resources” inside bin folder.But it is not even run the application via Visual studio.it throw an Exception says it cant find particular icon.

  • Can any one explain why this is happening?
  • How can i copy these Resource folder when deploy the application?Because i need my application read files from that folder at deployment environment.
  • If i Set the property to embedded Resource is it possible to replace the image at
    run time with another image?

Thanks in Advance:)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:15:43+00:00Added an answer on June 17, 2026 at 9:15 am

    To reference a relative path, set your Icon Location as;

    Icon="Resources/form1.ico"
    

    I’m not sure why your image isn’t being copied across.

    I’ve just tried this, and my icon is copied into the debug directory, within the Resources Directory.

    Just to be sure, are you definitely setting the “Build Action” of the Icon to “Content“, and the “Copy to output Directory” as “Copy Always“?

    Also, again just to be sure… Are you including the file in the project? That is, if you set the “Show All Files” option on, if you right click on the icon, you can include it in the project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF application and I added to the project resources many icons
I have WPF application project and I'm using EF. I want something like this.
I have a WPF application where I added the images as resources to the
Environment Visual Studio 2008 SP1 Visual C# WPF Application Project .NET Framework 3.5 Problem
Currently in my project directory I have a folder called Data and in it
I have a Wpf application project called WpfTest which references WpfTestLib (A class library).
I have two projects in my solution. The first project is a WPF application,
I made a simple WPF application in Visual Studio. It accesses its own database
I have a WPF application with form that has a textbox named txtStatusWindow. I
I have developed a WPF application and set up a deployment project. The installer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.