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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:21:47+00:00 2026-05-10T17:21:47+00:00

In my winforms application, AppDomain.CurrentDomain.BaseDirectory is set to C:\Projects\TestProject\bin\Debug\ In my unit tests it

  • 0

In my winforms application, AppDomain.CurrentDomain.BaseDirectory is set to ‘C:\Projects\TestProject\bin\Debug\’

In my unit tests it is ‘C:\Projects\TestProject\bin\Debug’ (no final slash). Why is this?

[Edit] @Will : I am asking why the test project’s directory doesn’t have a trailing slash?

  • 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-10T17:21:48+00:00Added an answer on May 10, 2026 at 5:21 pm

    You may be asking one of two possible questions: Why are they different, or why the test project’s directory doesn’t have a trailing slash.

    Assuming its the first: That’s where the code is executing from. When you debug the program, its compiled and the binaries are placed under the project’s \bin\debug directory. When you’re testing, you’re running the test’s binaries, which are compiled and placed under the test project’s bin\debug directory.

    Assuming its the last: Possibly some obscure reason, possibly a bug, or possibly to catch people who are concatenating paths rather than using Path.Combine (naughty naughty!).


    Well, I don’t know why it’s different. Test applications may be run within a custom CLR host; I think this may be the case as test apps do some weird stuff with private accessors that normally aren’t allowed within the standard CLR host. I’m only grasping at straws here as I don’t have any actual knowledge about how this stuff is actually being coded.

    Anyhow, the workaround stands (Path.Combine). Nobody should be concatenating paths, as path delimeters can change.

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

Sidebar

Related Questions

In a .net 2 winforms application, what's a good way to set the culture
My WinForms application has a button. This button has accelerator key (e.g. Alt+L). When
I have a winforms application i have been working on that runs multiple tests
In winforms application/asp.net sqlite works if i reference sqlite.dll. But when i try this
We have a WinForms application that we are progressively converting to WPF. At this
My WinForms application has a tab with a System.Windows.Forms.WebBrowser control. There are several controls
Our WinForms application has been reported to occasionally just close on its own. It
I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell
I have a winforms application that normally is at about 2-4% CPU. We are
We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component 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.