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 146335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:35:03+00:00 2026-05-11T08:35:03+00:00

I have some files I want to use in my unit tests but I

  • 0

I have some files I want to use in my unit tests but I want to make those files relative to location of the dll which contains the unit tests, is this possible?

In other words I have included a Resources folder which contain some files for my unit tests to use in testing, I marked the files ‘Build Action’ = ‘Content’ and ‘Copy to Output Direct’ = ‘Copy Always’ but that isn’t doing what I thought it would do. I thought it would copy the content along, but when my tests run, they say the files do not exist.

I would prefer to not resolve this by putting explicit paths, because these paths would then vary from developer machine to developer machine.

I also tried adding the following as a Pre-build event and also as a Post-build event, but that didn’t solve my problem either.

xcopy '$(ProjectDir)Resources\*.*' '$(OutDir)Resources\*.*' /i /d /s /y

If I make the previous a pre or post build event I see that the data is copied to my outdir, but it doesn’t make it to the TestResults folder which is where the Resources folder must also be copied for the tests to have any data to tests.

  • 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. 2026-05-11T08:35:04+00:00Added an answer on May 11, 2026 at 8:35 am

    The unittest runner must be copying your unittest assemblies to some temp folder. Instead of copying those resource files, consider including them as Embedded Resources and then loading them from assembly using Assembly.GetManifestResourceStream().

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

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I don't think you're doing anything wrong. See my answer… May 11, 2026 at 11:26 am
  • added an answer First off let's clean up that VB a bit: Public… May 11, 2026 at 11:26 am
  • added an answer You should use EVT_UPDATE_UI(yourCommandID, yourEventHandler) for checking/unchecking and enabling/disabling menu… May 11, 2026 at 11:26 am

Related Questions

I have coordinates from some source and want to tag my jpg files with
I want to have an executable file that will call some other programs. The
have downloaded Orca to edit an MSI file. I want to remove some banner
For a number of reasons, the canonical source of some files I have can't
I have some source files that have comments written in Japanese. When I open
I have some data files to import into a database with some unique delimiters:
I have uploaded some files to a directory under public and I try to
I'm looking to stream some audio files I have on my server to an
There is a data file and some image files that I have to download
I have some databases that have four files each; one for PRIMARY, IDX, IMAGE,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.