Re: Deploy/Debug/Run VB .Net 2005 WinApp with Form or Formless
- From: VorTechS <vortechs@xxxxxxxxxxxxxxxx>
- Date: Thu, 16 Aug 2007 14:44:01 GMT
Ruth wrote:
I am trying to deploy a Visual Basic .Net 2005 WinApp solution that can be run with or without a form. It should run with the form from the start menu. It should run formless from the command prompt when the switch is included.To test from the IDE:
The application runs fine in VS 2005 IDE with the form. I don’t know how to test the switch mode from the IDE (I deploy it and test the switch from a command prompt).
I used click once to deploy the application. When I run it at the start menu it works as expected - with the form. When I run it at the command prompt I select the exe that click once created followed by the switch - it runs both the form and formless options.
I am confused about this. Do you know what might be happening? I think it is running the exe with the form before the code is actually processed so the switch is recognized after the form is displayed.
Here is my sample code:
Public Sub Start()
'args = System.Environment.GetCommandLineArgs
'args = Split(Command$, " ")
Dim gOpenArgs() As String = Environment.GetCommandLineArgs()
Dim s As String
For Each s In gOpenArgs
Select Case s.ToLower
Case "/a" ' Automated
Dim LoadData As New ProcessCode
LoadData.RunFormless()
Application.Run()
Case Else
Form1.Show()
Application.Run()
End Select
Next
Application.Exit()
End Sub
Public Sub RunFormless()
Console.Beep()
Console.WriteLine("Hi")
Application.Exit()
End Sub
Q1 -Should I use click once to deploy or does anyone know how to deploy this solution as one application that runs from the start menu without the switch (with the form) and runs from the command prompt with the switch (No Form).
Q2 – How can I test the switch from the IDE window? I am not sure where/how to set the swtich in debug mode.
Project --> Properties --> Debug (Tab) --> Command Line Arguments
From what I remember, you have to be careful about the way you parse the arguments because arg(0) may be different in different circumstances, meaning the switch you are looking for starts in arg(1).
HTH
.
- Prev by Date: Run a macro/sequence of actions in VS.NET 2008?
- Next by Date: Re: Overriding TEXTBOX controls vb.net
- Previous by thread: Run a macro/sequence of actions in VS.NET 2008?
- Next by thread: Re: c# server problem
- Index(es):
Relevant Pages
|