Click to See Complete Forum and Search --> : Deploying .Net applications
dee-u
Jul 5th, 2005, 01:53 AM
Is there an equivalent of Package & Deployment Wizard (vb6.0) in .Net? What are the things I need to know to be able to deploy an app developed in .Net? I have two incoming projects and I wish to develop it in .Net to boost my experience in it but I'm afraid I don't know how to install the app when it is finished.
mendhak
Jul 5th, 2005, 03:58 AM
You won't have much of a problem deploying it. You have to keep in mind that the end user's machine must have the .NET framework on it.
And to create your setup, you can simply add a setup project to your VS.NET IDE solution explorer.
And it's also possible to deploy simply by copy-paste, provided that the framework exists of course.
dee-u
Jul 15th, 2005, 04:13 AM
And to create your setup, you can simply add a setup project to your VS.NET IDE solution explorer.
How to do that?
And it's also possible to deploy simply by copy-paste, provided that the framework exists of course.
You mean just copy the Exe made in .Net to the other computer as long as the framework exists in that computer?
mendhak
Jul 15th, 2005, 04:49 AM
Right click the solution, add project... setup project.
And
yes, as long as the framework exists, just copy over and double click
dee-u
Jul 15th, 2005, 04:50 AM
Thanks! :)
dglienna
Jul 15th, 2005, 11:50 PM
I just tried it, and in the Setup1 folder, tried to run both the msi file and the setup.exe file.
They both failed saying that the folder contained an invalid character.
I never specified a folder to install to, and it seemed to be trying to install to the name of my company name, which has a "/" in it.
RobDog888
Jul 16th, 2005, 10:47 AM
I guess no one reads the FAQ? There are two good step by step articles on .NET deployement.
Application Deployment FAQ (http://www.vbforums.com/showthread.php?t=315829)
:)
dglienna
Jul 16th, 2005, 02:52 PM
Well, I was following the Frog's advice. Maybe the wizard would have been a better choice? I'll look in to the config options to see what went awry.
I also tried to install it on my laptop, which created it. I don't know if that is a good idea, as I never tested installs on my own machine.
dee-u
Jul 20th, 2005, 08:45 PM
Well, the Copy-Paste didnt work! In this computer I have Microsoft .Net Framework 1.1, and my app is created using Visual Studion 2003. When I tried to run the app in this computer this error is raised:
"Application has generated an exception that could not be handled."
Could somebody tell me what is going on?
RobDog888
Jul 20th, 2005, 11:35 PM
Does your app use any references? Did you set any references to CopyLocal = True?
dee-u
Jul 20th, 2005, 11:42 PM
Yap, I am referencing the Webbrowser control (from VB6.0) and other controls.
CopyLocal = True
Where can I set that?
RobDog888
Jul 20th, 2005, 11:48 PM
If you set it to true then you wil have a local copy of the dependancy for distribution. Its better if your using references to
set it to False, for now. Did you place any error handling in the start of your app so you can tell where the error may be?
If you select your reference in the solution explorer you will see the property window change to represent the reference. Then
you wil see that prop and know what its sset to.
dee-u
Jul 20th, 2005, 11:53 PM
Ok, I'l check it our when I get home since I dont have .Net in this computer. :)
No error handling yet, I still cannot fully grasp the idea behind the Error Handling (Structured) in VB.Net and I'm afraid to use it now if I dont understand it fully well. :)
RobDog888
Jul 21st, 2005, 12:06 AM
Its not hard at all. Let me give it a try. :)
The Try Catch block at its simplest form as realted to VB6.
Try = On Error GoTo
Catch ex As Exception = Error Label:
End Try = End of Error Label Sub
'So to add some actual data for an example....
Try
Messagebox.Show((1/0).ToString) 'Generate an error
Catch ex As Exception
Messagebox.Show(ex.message, "Error")
End Try
'Is the same as the old VB6
On Error Goto MyError
MsgBox 1/0
Exit Sub
MyError:
MsgBox "Error"
dee-u
Jul 21st, 2005, 12:12 AM
After the code in Catch, where does it goes next?
Try
Messagebox.Show((1/0).ToString) 'Generate an error
Catch ex As Exception
Messagebox.Show(ex.message, "Error")
End Try
And what about Resume Next and Resume, what are their equivalents? :)
RobDog888
Jul 21st, 2005, 12:15 AM
Try
Messagebox.Show((1/0).ToString) 'Generate an error
Catch ex As Exception
Messagebox.Show(ex.message, "Error")
End Try
Messagebox.Show(I'm contnuing on from here. I'm the next line of code after the Try Catchblock as long as there is no other redirecting code in the Catch section. ;).")
dee-u
Jul 21st, 2005, 12:50 AM
How about this Gansta? How will it go the bold part?
Try
Messagebox.Show((1/0).ToString) 'Generate an error
Messagebox.Show ("Next Line1")
Messagebox.Show ("Next Line2")
Catch ex As Exception
Messagebox.Show(ex.message, "Error")
End Try
Messagebox.Show ("Next Line Again.")
RobDog888
Jul 21st, 2005, 12:52 AM
Nope, but let me look around for anything equilivalent for resume, etc.
RobDog888
Jul 21st, 2005, 12:55 AM
Ok, I got two examples or resume next (Btw, the vb6 on error handling is still in the S.VB namespace).
Try
' Starts a structured exception handler.
' Place executable statements that may generate
' an exception in this block.
Catch [optional filters]
' This code runs if the statements listed in
' the Try block fail and the filter on the Catch statement is true.
[Additional Catch blocks]
Finally
' This code always runs immediately before
' the Try statement exits.
End Try
' Ends a structured exception handler.
'AND FOR A SECOND EX
Function GetStringsFromFile(ByVal FileName As String) As Collection
Dim Strings As New Collection
Dim Stream As System.IO.StreamReader = System.IO.File.OpenText(FileName) 'Open the file.
Try
While True ' Loop terminates with an EndOfStreamException
' error when end of stream is reached.
Strings.Add(Stream.ReadLine())
End While
Catch eos As System.IO.EndOfStreamException
' No action is necessary; end of stream has been reached.
Catch IOExcep As System.IO.IOException
' Some kind of error occurred. Report error and clear collection.
MsgBox(IOExcep.Message)
Strings = Nothing
Finally
Stream.Close() ' Close the file.
End Try
Return Strings
End Function
dglienna
Jul 21st, 2005, 04:44 AM
That second one interests me. I saw that in the examples when it tries to connect to SQL and then MSDE.
It seemed to me that the try statement was a loop in itself, but I wasn't sure.
Your second example seems to loop through the file, reading all records, which is a neat way of doing that. Let me know if that is correct?
It would explain things a little better.
dee-u
Jul 22nd, 2005, 01:37 AM
This is an example error handler in VB6.0, how could I convert it to VB.Net?
lvwData_ColumnClick_Err:
Select Case ErrorGlobalHandler("AISIS.frmBKS.lvwData_ColumnClick")
Case vbAbort
Exit Sub
Case vbRetry
Resume
Case vbIgnore
Resume Next
Case Else
MsgBox Err.Description, vbCritical, "Critical Error Encountered"
End
End Select
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.