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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:39:45+00:00 2026-05-21T22:39:45+00:00

I am trying to use moles with NUnit and am getting the following error

  • 0

I am trying to use moles with NUnit and am getting the following error “Moles requires tests to be an instrumented process”. I am also using Visual NUnit within Visual Studio 2008 to get this working. Any help is welcome.

  • 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-21T22:39:46+00:00Added an answer on May 21, 2026 at 10:39 pm

    This is what I did in order to make Moles work with NUnit:

    1. Grab the archive at C:\Program Files (x86)\Microsoft Moles\Documentation\moles.samples.zip and extract the Moles solution folder.

    2. Build the NUnit project in Visual Studio (2008) for Release.

    3. Copy the output files Microsoft.Moles.NUnit.dll and Microsoft.Moles.NUnit.xml from ...\Moles\NUnit\bin\Release\ to C:\Program Files (x86)\NUnit 2.5.9\bin\net-2.0\addins\. I suspect that this step of re-compiling the NUnit addin instead of using the one coming from the download & install was the actual solving point.

    4. In your VS test project, make sure you add a reference to the C:\Program Files (x86)\NUnit 2.5.9\bin\net-2.0\addins\Microsoft.Moles.NUnit.dll you just copied.

    5. In your VS test class, mark a test method with the [Moled] attribute (this will require an using Microsoft.Moles.Framework.NUnit). As an alternative, wrap its implementation within an using (MolesContext.Create()) { ... } block (this will require an using Microsoft.Moles.Framework).

    6. From the command line, invoke NUnit test runner through the moles runner with the following: "C:\Program Files (x86)\Microsoft Moles\bin\moles.runner.exe" "path\to\your\test\assembly.dll" /r:"C:\Program Files (x86)\NUnit 2.5.9\bin\net-2.0\nunit-console.exe" /x86 /args:"/domain=None"

    I found that [Moled] attribute does not work with [TestCase(…)] and it brings you back to the uninstrumented error scenario. Instead the using (MolesContext.Create()) block works in that case too.

    Once you find that everything works, you might consider running moles runner as an external tool within Visual Studio. Follows instructions in Running Moles using NUnit Console from Visual Studio, updating the arguments as in step 6.

    Please note that this was on a Windows 7 64bit machine, with NUnit 2.5.9, Microsoft Pex and Moles (x86) 0.94.51006.1. Consider your actual folders for different paths, versions, etc.

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

Sidebar

Related Questions

trying to use hibernate with my web app and getting following exception: Initial SessionFactory
I'm trying to use Mole for Visual Studio but it's not loading. I've had
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to set up Moles to use in our unit testing. We are
I'm trying to use Moles to mock the Socket class in System.Net.Sockets. I have
I am trying to use following code to perform few animations -(void) performSlidingfromX:(int) xx
I'm trying to use the two following methods to recursively traverse arrays of arrays
I was trying to find a consistent description on how to use moles isolation
I'm trying to get our team to use Moles and Stubs primarily to Mole
I am using NUnit asserts within a MSTest project like as follows ( NOTE:

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.