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

  • SEARCH
  • Home
  • 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 8475443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:53:39+00:00 2026-06-10T17:53:39+00:00

I have a .Net solution comprising several projects. One of these projects holds all

  • 0

I have a .Net solution comprising several projects. One of these projects holds all the business logic on which depends a WPF project.

The business logic projects uses a bunch of resource files for different functionality.

Previously the two projects were only one, so what I did then is to set all these resource files to “Copy to Output Directory” to true. The running application composed the file paths as follows.

static readonly string ResourceFilePath = 
    Path.Combine(
        Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
        "resources\\thefile.ext");

I know I can use resources and that works fine (except for the disappearance of the extension, and the replacement of . characters with _).

However, there are also times where I have directory tree holding a bunch of files. The running application copies the whole thing in some temporary location.

As with individual resource files, I had all the files set to be copied to the output directory in Visual Studio. The running application would compose the path of the directory, and then use that path to recursively copy everything to the temporary location.

static readonly string ResourceFilesPath = 
    Path.Combine(
        Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
        "resources\\somedirectory\\");

public void CopyAll(DirectoryInfo source, DirectoryInfo target)
{
...

This all worked well while debugging in Visual Studio, and also with the application installed. And because the files are on disk, they were individually version controlled.

My problem is with the second scenario where I copy a directory and file structure. I can’t do that with resources, and now that the business logic is in a separate project, the resource files are not copied in the output directory of the front-end project.

My question is: are there better approaches to deal with many resources in some directory tree?

  • 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-10T17:53:40+00:00Added an answer on June 10, 2026 at 5:53 pm

    Maybe you can use GetAssembly or GetEntryAssembly to get a reference to the WPF assembly so the Location properly returns the desired output path?

    Or you can set up build events for the business logic project to copy the resources to WPF project’s output path.

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

Sidebar

Related Questions

I have a .NET solution which consists of several projects. It's possible to say
I have a .NET solution which was badly organised, so I moved some projects
I have a .Net solution with 5 projects in c# and one in visual
I have developed a .NET solution that consists of several assemblies, most of which
I have a solution that contains several projects. One of the test projects is
I have several projects and a website in a large asp.net solution. In some
We have VS.Net solution with 20 projects in it. Occasionaly, in VS.NET, when we
I have a ASP.NET MVC3 solution with 2 projects it in. Let's call it
I have a .NET 4.0 solution with about 10 projects that I am successfully
I have a lot of projects in my .NET solution. I would like to

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.