How can I build a Project programattically in VB.NET ?
-
Do you mean you want to automate your build?Miyagi Coder– Miyagi Coder2009-01-29 20:48:03 +00:00Commented Jan 29, 2009 at 20:48
-
I basically have an Add-In project that inspects variables in a loaded project, writes them to the database, then compiles (builds) the loaded project.Kingamoon– Kingamoon2009-01-29 20:49:56 +00:00Commented Jan 29, 2009 at 20:49
Add a comment
|
4 Answers
The following code compiles a application on form load, although would it not be a better idea to have any variables that change stored in a external settings file rather re-compile the application ?
Imports System.Diagnostics.Process
Public Class Form1
Public Sub BuildProject(ByVal pProject As String)
Dim lBuildString As String = String.Format("C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe {0} /t:Rebuild /p:Configuation=Release", pProject)
Dim lReturnID = Shell(lBuildString, AppWinStyle.NormalFocus, False)
'System.Diagnostics.Process.Start(lBuildString)
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
BuildProject("C:\Programming\CommunicationsService\Communications_Service\Service_Tem[\Service_Tem[.vbproj")
End Sub
End Class