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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:08:03+00:00 2026-05-14T03:08:03+00:00

In a nutshell, I have a solution that builds fine in the IDE, and

  • 0

In a nutshell, I have a solution that builds fine in the IDE, and the unit tests all run fine with the NUnit GUI (via the NUnitit VS2008 plugin). However, when I execute my TeamCity build runner, all unit tests that require file access (e.g. for running tests against specific XML files), I just get System.IO.DirectoryNotFoundExceptions.

The reason for this is clear: it’s looking for those supporting XML files loaded by various unit tests in the wrong folder.

The way my unit tests are structured looks like this:

+-- project folder
    +-- unit tests folder
        +-- test.xml
        +-- test.cs
    +-- project file.xaml
    +-- project file.xaml.cs

All of my projects own their own UnitTests folder, which contains the .cs file and any XML files, XML Schemas, etc that are necessary to run the tests.

So when I write my test.cs, I have it look for “test.xml” in the code because they are in the same folder (actually, I do something like ….\unit tests\test.xml, but that’s kind of silly). As I said before, the tests run great in NUnit. But that’s because the unit tests are part of the project. When running the unit tests from TeamCity, I am executing them against the assemblies that get copied to the main app’s output folder. These unit test XML files should not be copied willy-nilly to the output folder just to make the tests pass.

Can anyone suggest a better method of organizing my unit tests in each project (which are dependencies for the main app), such that I can execute the unit tests from NUnit and from the TeamCity build runner? The only other option I can come up with is to just put the testing XML data in code, rather than loading it from a file. I would rather not do this.

  • 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-14T03:08:03+00:00Added an answer on May 14, 2026 at 3:08 am

    Sometimes, sleeping on a question before posting it is the best thing to do. I should have known that I should just enter the relative paths of the assemblies’ own project debug folder. Problem solved.

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

Sidebar

Related Questions

I have this code copied from C# 4.0 in a nutshell that uses Attribute/Reflection
In a nutshell on page1.php I have a calculator that consists of an HTML
In a nutshell: I have some database table data that I want to populate
I have a controller that in nutshell is as follows: public function download($id) {
So the scenario in a nutshell: I have an entity (EF4) that has a
I have an onCreate method that runs the code below. In a nutshell the
i have came across the sentence in a nutshell while reading a technical book
In a nutshell , I want to have different faces for some types of
I know that there have been a number of posts regarding the height:100% declaration
I'm aware that similar questions on SO are numerous, but I have a caveat.

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.