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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:06:33+00:00 2026-05-15T04:06:33+00:00

I’ve got an MVC web application with associated controller tests that run under a

  • 0

I’ve got an MVC web application with associated controller tests that run under a TFS build as per normal.

I can see the tests running and passing in the build log and they appear in the “Result details for Any CPU/Release” section of the build

I also have a number of other assemblies with associated tests that are running in the same build. Tests are passing and the details are being shown in the results and logs just fine.

I’ve enabled code coverage in the build script and the testrunconfig.
The coverage is appearing for all assemblies EXCEPT the web application even though it looks like the tests have been run for it.

Is there anything obvious that I have missed or some sort of work around that I need to do?
I’ve searched around for a while and haven’t found an answer.

Has anyone got code coverage working for MVC web applications using TFS?

  • 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-15T04:06:33+00:00Added an answer on May 15, 2026 at 4:06 am

    After reading the article posted earlier I thought I would try an alternate approach.

    looking at the localrun.testconfig in a text editor I saw that the assemblies that contained code coverage data were in the section below

    <Regular>
    <CodeCoverageItem ... />
    <CodeCoverageItem ... />
    </Regular>

    The only reference to a web project was in the section:

    <AspNet>
    <AspNetCodeCoverageItem id="..." name="..." applicationRoot="/" url="http://localhost:0/" />
    </AspNet>

    So to get code coverage working in TFS:
    In VS IDE, double click the localrun.testconfig, then click Code Coverage and then manually add the MVC assembly by clicking the Add Assembly… button. You will get a warning message about duplicate assemblies, tell it to use this new file.

    What this does behind the scenes in the localrun.testconfig is add a CodeCoverageItem
    entry with the MVC assembly and removes the AspNet section from the CodeCoverage section of the file.

    This has the added benefit of not starting up a local web server every time you run your tests.

    But it may have a detrimental effect on any Watin type tests and coverage.

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

Sidebar

Ask A Question

Stats

  • Questions 424k
  • Answers 424k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In multi-threading that clause if(!p_inst) { p_inst = new Singleton();… May 15, 2026 at 11:50 am
  • Editorial Team
    Editorial Team added an answer You are looking for CURDATE(): $db->query("SELECT * FROM events WHERE… May 15, 2026 at 11:49 am
  • Editorial Team
    Editorial Team added an answer Look at south May 15, 2026 at 11:49 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.