Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. How do I Clean & Build my entire project via code?

How do I Clean & Build my entire project via code?

Scheduled Pinned Locked Moved Visual Studio
helpquestionjavacsharp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TekkGuy
    wrote on last edited by
    #1

    I come across a problem in VS2005 which has been driving me crazy. Sporadically (and more often then not) when I attempt to open a form in Design view, I get an error page stating that a project dependency (another project that I added to the solution) could not be found. 98% of the time, my entire IDE crashes and I have to restart VS2005. The only way to fix this that I have found it to do the following steps: 1) Clean the Solution 2) Build Solution 3) Clean Project #1 4) Build Project #1 5) Clean Project #2 6) Build Project #2 Doing this manually several times a days is more then a little irritating. (Ultimately I would like to be able to fix whatever is causing this "lost dependency" problem) For now I would like to be able to do all the above using a macro, but I an not familier with the required Syntax. I worked out some of the code, but I am still at a loss on the command to Clean a specific Project. I been able to gather the folowing information....(Note this is just a small excerpt of my entire Macro Code)

    ' This Builds The Project
    Dim objSolution As Solution = DTE.Solution
    Dim objProject As Project 'Value Supplied By Other Routine
    With objSolution.SolutionBuild
    .BuildProject(.ActiveConfiguration.Name, objProject.UniqueName, True)
    End With

    Question is....how do I CLEAN the project before I build it? Help...!

    ________________________ Ben Santiago, MCP & A+ Programmer (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS) Eastern Suffolk BOCES - Student Data Services Programming: Race between programmers building better idiot-proof apps, and the Universe producing better idiots. The Universe is winning. -Rich Cook

    C 1 Reply Last reply
    0
    • T TekkGuy

      I come across a problem in VS2005 which has been driving me crazy. Sporadically (and more often then not) when I attempt to open a form in Design view, I get an error page stating that a project dependency (another project that I added to the solution) could not be found. 98% of the time, my entire IDE crashes and I have to restart VS2005. The only way to fix this that I have found it to do the following steps: 1) Clean the Solution 2) Build Solution 3) Clean Project #1 4) Build Project #1 5) Clean Project #2 6) Build Project #2 Doing this manually several times a days is more then a little irritating. (Ultimately I would like to be able to fix whatever is causing this "lost dependency" problem) For now I would like to be able to do all the above using a macro, but I an not familier with the required Syntax. I worked out some of the code, but I am still at a loss on the command to Clean a specific Project. I been able to gather the folowing information....(Note this is just a small excerpt of my entire Macro Code)

      ' This Builds The Project
      Dim objSolution As Solution = DTE.Solution
      Dim objProject As Project 'Value Supplied By Other Routine
      With objSolution.SolutionBuild
      .BuildProject(.ActiveConfiguration.Name, objProject.UniqueName, True)
      End With

      Question is....how do I CLEAN the project before I build it? Help...!

      ________________________ Ben Santiago, MCP & A+ Programmer (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS) Eastern Suffolk BOCES - Student Data Services Programming: Race between programmers building better idiot-proof apps, and the Universe producing better idiots. The Universe is winning. -Rich Cook

      C Offline
      C Offline
      Chris Buckett
      wrote on last edited by
      #2

      Not sure how to do it in a macro, but you could do it in a batch file with ms build. Run the "Visual Studio 2005 command prompt" and type msbuild /? From the help messages:

      Examples:

          MSBuild MyApp.sln /t:Rebuild /p:Configuration=Release
          MSBuild MyApp.csproj /t:Clean /p:Configuration=Debug
      

      Hope that helps.

      ChrisB

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups