S
Sam
Does anyone know how I can call vbc.exe from a Windows Application and
return the output messages?
I thought I might be able to do it using the
System.Diagnostics.Process object. I have got it executing correctly
and I am able to perform builds using this object, however cannot get
feedback to my Windows Application by way of verbose messages to
verify the build was successful.
I have attempted to append a pipe style argument to the end of the
arguments I pass into the Process object, however they cause the
process to fail. I assume it is because vbc.exe does not recognise a
piped command as an argument for itself, even though the same
arguments used directly in a command window execute correctly.
I am thinking of the piped command to file argument to allow me to
monitor the file for changes and dynamically display it in my Windows
Application. If there is a better way that someone knows about then I
would love to hear about it.
<SampleCode>
Dim compile As System.Diagnostics.Process
' Create new Process object
compile = New System.Diagnostics.Process()
With compile
.StartInfo.FileName =
"C:\Windows\Microsoft.NET\Framework\v1.0.3705\vbc.exe"
.StartInfo.Arguments = "/out:bin/MyDll.dll /t:library /verbose
Test.vb > c:\VerboseOutput.txt"
.Start()
.Close()
End With
</SampleCode>
Thoughts? Comments?
Thanks,
Sam.
return the output messages?
I thought I might be able to do it using the
System.Diagnostics.Process object. I have got it executing correctly
and I am able to perform builds using this object, however cannot get
feedback to my Windows Application by way of verbose messages to
verify the build was successful.
I have attempted to append a pipe style argument to the end of the
arguments I pass into the Process object, however they cause the
process to fail. I assume it is because vbc.exe does not recognise a
piped command as an argument for itself, even though the same
arguments used directly in a command window execute correctly.
I am thinking of the piped command to file argument to allow me to
monitor the file for changes and dynamically display it in my Windows
Application. If there is a better way that someone knows about then I
would love to hear about it.
<SampleCode>
Dim compile As System.Diagnostics.Process
' Create new Process object
compile = New System.Diagnostics.Process()
With compile
.StartInfo.FileName =
"C:\Windows\Microsoft.NET\Framework\v1.0.3705\vbc.exe"
.StartInfo.Arguments = "/out:bin/MyDll.dll /t:library /verbose
Test.vb > c:\VerboseOutput.txt"
.Start()
.Close()
End With
</SampleCode>
Thoughts? Comments?
Thanks,
Sam.