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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:11:01+00:00 2026-05-24T03:11:01+00:00

I am using the MSBuild engine to run a deployment on Team Server Database

  • 0

I am using the MSBuild engine to run a deployment on Team Server Database Project:

var propertyGroup = new BuildPropertyGroup();
propertyGroup .SetProperty("Configuration", "Release");
propertyGroup .SetProperty("TargetDatabase", <databasename>);
propertyGroup .SetProperty("UseSandboxSettings", "false");
propertyGroup .SetProperty("DeployToDatabase", "true");
propertyGroup .SetProperty("TargetConnectionString", LocalHostConnectionString);
new Engine().BuildProjectFile(<DBProjFile>, new[] { "Rebuild", "Deploy" }, propertyGroup);

This is being run in a setup fixture for a suite of unit tests. When run using Resharper the setup runs in a reasonable amount of time however if I Debug the tests I get loads of Trace noise in the Debug output. Most of the messages are logged at a verbose level.

I have reflected over some of the assemblies involved and found that there is a TraceSource with the name “TSData” that is created in the static class Microsoft.Data.Schema.Common.Diagnostics.TSDTrace, Microsoft.Data.Schema.Utilities.

I have tried applying the following to the app.config which has stopped any output appearing in the Debug window but the run time is unaffected:

<system.diagnostics>
    <sources>
        <source name="TSData" switchName="foo" />
    </sources>
    <switches>
        <add name="foo" value="Off"/>
    </switches>
</system.diagnostics>

In the logging class there is this little gem:

if (TSDTrace.Settings._traceIfDebuggerAttached && Debugger.IsAttached)
{
    TSDTrace.Settings._traceToDebugOutput = true;
    TSDTrace.Settings._traceLevel = TraceLevel.Verbose;
}

Where _traceIfDebuggerAttached is always true. I am hopping that I have missed something. Ultimately I would like to disable this from code but I would settle for a solution involving the app config.

EDIT

I had made a mistake, the Trace Source is in-fact “TSData” which I have amended above. I have set the log level to Off in the app.config which has prevented the output from appearing in the Debug output but the speed is still the same. It appears this issue is more specific to what I am trying to do so I have added more detail to the original question.

  • 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-24T03:11:02+00:00Added an answer on May 24, 2026 at 3:11 am

    It seems that Microsoft.Build.BuildEngine.Engine has been deprecated, instead I should have been using Microsoft.Build.Evaluation.ProjectCollection instead.

    I have changed the code to use the new object and everything works much faster and I do not need to try and disable any logging via systems diagnostics in the log file. The code now reads:

    var properties = new Dictionary<string, string>
        {
            {"Configuration", isDebug ? "Debug" : "Release"},
            {"TargetDatabase", databaseName},
            {"UseSandboxSettings", "false"},
            {"DeployToDatabase", "true"},
            {"TargetConnectionString", LocalHostConnectionString}
        };
    
    using (var engine = new ProjectCollection(properties))
    {
        engine.RegisterLogger(new ConsoleLogger());
    
        engine
            .LoadProject(databaseProjectFileName, "4.0")
            .Build(new[] {"Build", "Deploy"});
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MsBuild 4.0 in code, like so: var globalProperties = new Dictionary<string,
I am writing a deployment script using MSBuild. I want to clean my web
When I execute delphi 2009 project using MSBuild command line, output always goes to
I am using msbuild to run an .proj file which reads the file name
I'm attempting to build a project using MSBuild (v4.0) on a 64-bit machine. For
Is there a good tutorial for Creating a database using msbuild ? jean paul
I am trying to build and deploy a .NET 4 project using MSBuild Web
Using MsBuild 4.0 I included a pre-build event that generates one of the project
I'm trying to write a MSBuild project that will generate html documentation using doxygen.
I'm using msbuild to automatically build and package a website ready for deployment. When

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.