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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:11:00+00:00 2026-06-04T08:11:00+00:00

I have a standard WPF application. The VS solution has a main project and

  • 0

I have a standard WPF application.
The VS solution has a main project and a unit test project (using the standard VS unit test suite)

For testing purposes beyond unit tests (e.g. just interactively trying out a new piece of code) I have to wait for my whole application to start and then click my way to the form I want to test.

I’d prefer if I could choose an alternative build with a different entry point, which skips all the stuff I do not need and drops me off right where I want to.
I have created an additional build configuration besides “debug” and “release” called “debug (test)”.
How do I set different startup object that is executed when I choose this build?

Or is there an alternative solution for this problem? To simplify testing and profiling I’d prefer something that does not involve adding an additional project or dll.

One possible solution would be to define a compiler symbol and check for it in my app.xaml.cs

#if DEBUG_TEST
    TestWindow view = new TestWindow();
    view.Show();
#else
    MainWindow view = new MainWindow();
    view.Show();
#endif

anything less hacky?

  • 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-06-04T08:11:02+00:00Added an answer on June 4, 2026 at 8:11 am

    I don’t know why you consider this approach ‘hacky’.
    This seems to be the right way to go.
    Just select your configuration DEBUG(TEST) and add the DEBUG_TEST define to the properties page of your project.

    Return to normal configuration when you have done with your tests.

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

Sidebar

Related Questions

Say we have a standard WPF-application, and I want to show some UI-elements on
I have a FlowDocument in a standard WPF application window where I have some
I have a WPF application running with VS2010 .Net3.5 using Nhibernate with FluentNHibernate +
I have a WPF window with a textbox, using standard WPF Databinding to an
I have a C# WPF application using a rather noddy MVVM approach. In one
I am developing a WPF application (using MVVM) and have implemented IDataErrorInfo on my
What I have so far is: A WPF application, using MVVM, IDataErrorInfo implemented. Everything
I have written a WPF Application with a datalayer using Entity Framework 4 (EF4,
I have a WPF application which hosts a (activeX) VisioDrawingControl (using WindowsFormsHost) I'm trying
I have a WPF 4 application where I have implemented Drag and Drop using

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.