Deploy/Run VB .Net WinApp with Form or Formless

R

Ruth Sanders

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.

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.

From http://www.developmentnow.com/g/38_2006_8_15_0_0/dotnet-languages-vb.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
R

rowe_newsgroups

Q2 - How can I test the switch from the IDE window? I am not sure where/how to set the swtich in debug mode.

You can set this under the Project properties (Project --> MyAppName
Properties --> Debug Tab --> Command line arguments). With that you
should be able to determine whats going on which the modes. If not let
us know and I'll look into it further.

Thanks,

Seth Rowe
 
G

Guest

Thanks... When I attempt to run the app the following message appears:
"The current project settings specify that the project will be debugged with
specific security permissions. In this mode, command line arguments are not
passed to the executable. ...."

Within the Security Tab I selected "Partial Trust" with Zone set to local
and used all Zone Defaults. This does not work. Do you have any suggestions?
 
R

rowe_newsgroups

Thanks... When I attempt to run the app the following message appears:
"The current project settings specify that the project will be debugged with
specific security permissions. In this mode, command line arguments are not
passed to the executable. ...."

Within the Security Tab I selected "Partial Trust" with Zone set to local
and used all Zone Defaults. This does not work. Do you have any suggestions?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1697703&SiteID=1

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top