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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:41:36+00:00 2026-05-24T08:41:36+00:00

I want stop my Build process through MSBuild, if there is pending migrations. But

  • 0

I want stop my Build process through MSBuild, if there is pending migrations.

But I don’t want to trigger the Migrate target while building my project.

So, How can I check only pending migrations with Migratordotnet ?
I just want to use it as a flag to stop my Build process.. !!

Thanks in advance !

  • 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-24T08:41:37+00:00Added an answer on May 24, 2026 at 8:41 am

    Check this other question which shows some code to allow you to check if there are pending migrations. It could be quite possible to have a target set up in MSBuild to run this code and exit from the target if it returns one or more migrations available.

    Here’s some basic code for a console app that pulls together the code of the other question. It simply writes a message to the console window if migrations are available or not. You’ll need to expand it into what your needs are, but it should work. TestMigration1 should be replaced by one of your migration classes in the assembly where your migrations are. You’ll obviously need to make a reference to that project from your console app.

    internal class Program {
        private static void Main(string[] args) {
            Assembly asm = Assembly.GetAssembly(typeof (TestMigration1));
            const string myConnectionString =
                "Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;";
            ITransformationProvider provider = ProviderFactory.Create("SqlServer", myConnectionString);
            var loader = new MigrationLoader(provider, asm, false);
            List<long> availableMigrations = loader.GetAvailableMigrations();
    
            Console.WriteLine(availableMigrations.Count > 0 ? "Migrations available" : "No migrations");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to stop polling server in SignalR? I want to stop
Microsoft seems to want us to stop using the MDI, but if more people
i build a jQuery function here http://jsfiddle.net/JuW3B/3/ i want this function stop animating and
I want to use ALAssetsLibrary framework for displaying photos from the photo album.But while
I want to build a shell script to execute the following two commands, but
I want to stop click on any links until the page is loaded. Can
I want to stop outgoing call and open the application. The app is able
for example, if I want to stop lan connection 1 in my control pannel,
I parse a big xml document with Sax, I want to stop parsing the
I have one image animation started using GameQuery. Now I want to stop the

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.