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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:21:33+00:00 2026-06-18T19:21:33+00:00

We have the following setup: Visual Studio 2012 / SQL Server 2012 TFS 2010,

  • 0

We have the following setup:

  • Visual Studio 2012 / SQL Server 2012
  • TFS 2010, Build Server runs unit tests automatically on build.
  • A solution with lots of code and 2 Test Projects (so 2 separate assemblies at build time), the tests are done with Visual Studio’s unit test framework.
  • The first assembly contains all actual unit tests, and they all run ok. Within most tests, we write some data in the db, run some code,
    then clean the data.
  • We use the second assembly for database seeding. Since the tests and assemblies are loaded/executed in alphabetical
    order, we have a test in the second assembly whose name starts with
    “Z” (the assembly name also starts with “Z”). The build server logs
    also confirm that the Z test is the last to be executed. So this test
    only writes some data in the db. We preferred this for seeding versus
    using a DB project due to an existing infrastructure which
    reads data from Excel files and writes to SQL Server.

The problem is that when we run all tests on our dev machines, the Z test is executed last, and the seed data remains in the database. When the tests are executed on the build server, the Z test is also executed last, but the data doesn’t remain in the db.

According to the SQL Server profiler, the inserts/create tables are executed, so the data gets in the db both on our machines and on the build server, but on the build server some delete/drop queries are executed right after the inserts. We couldn’t tell where they are coming from.

We tried running only the Z test assembly and the data remains in the database. So the drops must be caused by the other assembly somehow. But how? And why is there a difference between the ways visual studio and the build server run the tests?

Has anyone encountered something like this before?

  • 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-18T19:21:35+00:00Added an answer on June 18, 2026 at 7:21 pm

    We managed to fix it in the end. It turns out that the first assembly had some cleanup code that ran in a [ClassCleanup] method. The first assembly’s ClassCleanup code ran after the Z test (from the second assembly). So the quick fix was just to replace the Z seeding test with an [AssemblyCleanup] method which did the seeding.

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

Sidebar

Related Questions

I have virtual machine that has windows 7 + visual studio 2010 setup, and
I have a Visual Studio 2010 Deployment Project with the following settings: DetectNewerInstalledVersion =
I have recently setup openCV 2.3.1 in Visual Studio 2010. I set it up
I'm trying to code DRY, and I have the following setup, which Visual Studio's
I have a Visual Studio setup project that installs an application into the task
I have a setup project created by Visual Studio 2005, and consists of both
I have a Visual Studio 2010 Windows Forms application in which I start a
I have a desktop application developed with Lightswitch using Visual Studio 2012. The app
I have developed a Windows service along with a setup project using Visual Studio
I have a database project in Visual Studio 2012. I am trying to create

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.