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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:34:53+00:00 2026-05-30T14:34:53+00:00

I am using MS Unit Tests in VS2010. I created a class that reads

  • 0

I am using MS Unit Tests in VS2010.

I created a class that reads a file..just a static word list. The file was added to the main project and the test project as content with “Copy always” selected as the build event.

When I run the unit test, however, it looks for the file in the output directory of the unit test. How do you make it look in the bin directory. I don’t want to mess with absolute filepaths just for testing…

Test method RequiredServicesTest.RequiredServices_JamesTest.Number2WordsTest threw exception:



Test method RequiredServicesTest.RequiredServices_JamesTest.Number2WordsTest threw exception: 
System.IO.FileNotFoundException: Could not find file E:\scomA3proj\TestResults\James_JAMES-PC 2012-02-24 21_22_17\Out\randomdictionary.txt.

Update: One thing I forgot to mention is that this is a WCF Service Library project.

  • 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-30T14:34:54+00:00Added an answer on May 30, 2026 at 2:34 pm

    I try to store my test files as an embedded resource in the test class and extract them to a temporary directory (with auto clean up / delete functions) so I never have to worry about where the files live. It seems to be easier and more stable this way.

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

Sidebar

Related Questions

I have a very large code base that contains extensive unit tests (using CppUnit).
When I try using unit tests (Microsoft vs2010-embedded testing framework) with MVC3, all unit
I believe strongly in using unit-tests as part of building large multi-platform applications. We
We are currently using unit tests to test our project. We have the majority
I'm looking into using parallel unit tests for our project(s) and was wondering about
I have been writing unit tests using NUnit and Moq with my Silverlight code
In the past I wrote most of my unit tests using C# even when
I had set up a bunch of NUnit unit tests using the Test connection
I'm using asserts_redirected_to in my unit tests, and I'm receiving this warning: DEPRECATION WARNING:
Using Moq for generation of Stubs and Mocks in my unit tests, I have

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.