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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:07:18+00:00 2026-05-16T03:07:18+00:00

I am writing some unit tests and I need to be able to access

  • 0

I am writing some unit tests and I need to be able to access an external file. I assumed I could just place the file in my solution, mark it to be copied to the output directory, and then access it via a relative path. Unfortunately, it seems that unit tests are run in a strange directory.

So, instead of running from:

[MyUnitTestProjectFolder]\bin\Release

it runs from:

[MySolution]\\[TheProjectI'mTesting]\TestResults\\[MyUsername]_[MyComputerName] [DateTimeStamp]\Out

My question is, how do I set up access to external files I need to utilize from my unit tests?

Note, the files aren’t text files. They are a proprietary flat-file database format (created from another application), so preparing these files “on the fly” during the test run is not feasible.

  • 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-05-16T03:07:19+00:00Added an answer on May 16, 2026 at 3:07 am

    You can do this via test run configurations: Open the Test menu, “Edit Test Run Configurations”, choose a test configuration to edit, and select the “Deployment” view. Here you can add any extra files that need to be deployed.

    Alternatively, you can use the DeploymentItem attribute on your tests.

    I’ve looked at visual studio 2008, but I assume the same features exists in visual studio 2010.

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

Sidebar

Related Questions

I'm writing some unit tests and I need to be able to Assert whether
I could not really find this in the documentation. I'm writing some unit tests
I was writing some Unit tests last week for a piece of code that
I am currently writing some unit tests for a business-logic class that includes validation
I'm writing some unit tests which are going to verify our handling of various
I am in the process of writing some unit tests for my controllers in
I am writing unit tests for some of my code and have run into
I'm writing some Unit tests against a database, and we're using transactions to make
I am in the process of writing some unit tests. In particular I want
As part of the base class for some extensive unit testing, I am writing

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.