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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:19:16+00:00 2026-05-16T01:19:16+00:00

I have written a bunch of unit tests inside VS2010 Express and tests being

  • 0

I have written a bunch of unit tests inside VS2010 Express and tests being tests they sometimes fail. Since the express editions of VS don’t allow plugins to run I can’t simply spin up TestDriven.Net or an equivalent and debug the tests. To try and work around this I’ve converted my test assembly into a console app and made the main method look like this:

class CrappyHackToDebugUnitTestInVSExpress
{
  public static void Main()
  {
     AppDomain.CurrentDomain.ExecuteAssemblyByName(
          @"C:\Program Files\NUnit 2.5.5\bin\net-2.0\nunit-console.exe",
          new [] { Assembly.GetExecutingAssembly().Location, "/framework:4.0" });
  }
}

In theory I should be able to run this up, set break points in my test. If it worked it would be an acceptable work around, but I keep getting the following:

FileLoadException
Could not load file or assembly 'C:\\Program Files\\NUnit 2.5.5\\bin\\net-2.0\\nunit-console.exe' 
or one of its dependencies. The given assembly name or codebase was invalid. 
(Exception from HRESULT: 0x80131047)

Now the file exists and when run manually nunit-console runs fine. What might be my problem?

  • 1 1 Answer
  • 1 View
  • 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-16T01:19:17+00:00Added an answer on May 16, 2026 at 1:19 am

    I played with your concept and it appears the issue isn’t directly from loading the file, but from dependencies.

    I used the following modified code:

    And the error was actually a failure to locate nunit.core.dll, which is in the /lib directory.

     try
            {
                String NUnitPath = @"C:\Program Files\NUnit 2.5.7\bin\net-2.0\nunit-console.exe";
    
                AssemblyName asmName = System.Reflection.AssemblyName.GetAssemblyName(NUnitPath);
    
                AppDomain.CurrentDomain.ExecuteAssemblyByName(asmName, new[] { Assembly.GetExecutingAssembly().Location, "/framework:4.0" });
    
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
                Trace.WriteLine(ex.StackTrace);
            }
    

    (I like getting System.Reflection.AssemblyName because you can inspect and see that everything’s in order verses the raw file path.)

    A quick bulk copy (xcopy nunit.*.dll) into my test projects’ debug directory and it ran just fine. (It should be trivial to discover the minimal dependencies required)

    Tested in VC# 2010 Express with NUnit 2.5.7 (breakpoints work, but I didn’t really play with any other options.) Although I’m sure you could make a passable build option from it.

    Cheers!

    PS – First post here so I’m a bit untested as to getting the ‘code’ blocks formatted. Sorry in advance..

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

Sidebar

Related Questions

I have a whole bunch of unit tests written in MbUnit and I would
I have written a script that goes through a bunch of files and snips
I have written a program using Microsoft Visual C# 2010 Express. I need to
I have written a bunch of entities. I am trying to test them now.
I have written an application that basically gathers up a bunch of text and
I have written a Google App Engine application that programatically generates a bunch of
I have written a function which takes a whole bunch of files, zips them
I have written a large script to run a series of tests. Each test
I have an openGL display that I would like to write unit-tests for. However,
We have written a bunch of Java code and need to package this code

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.