Did'nt copy ALL the DLL's but only got an error message for one of the DLL's. Anyway, i have now created a MSI install which works better. Thanks
barney_1972
Posts
-
Calling Windows App from command line prompt? -
Publish OR install projectI am creating a VB.NET windows application and am unsure at whether i should be publishing the final executeable or creating a install/deployment project. I have tried the publish route (both to a web url and a directory) and the program installs fine. However i want to control where the exe file is sent and the publish does'nt seem to give me that. Is this what the install/deployment route will give me? Or is there a valid reason for using one over the other? (Yes, i am a .NET newbie) Regards
-
Calling Windows App from command line prompt?I have a VB.NET windows app that i have built an exe file for. I orignally put the .exe file on the c:\ for ease of testing but the app didn't work. It complained 'PublicKeyToken=null or one of its dependencies. The system cannot find the file specified.' I have solved this by Publishing and installing the application, instead of just copying the exe file and config file across. However the publish wizard gives me the option of were to publish the install to but not where the install puts the exe file. How can i do this?
-
App.Config??I intended to have the App.config file as a sort of config.ini file and have set up many application variables there. However i noticed that the .exe file does'nt complain if the app.config file is not around, so i can only assume that the file is embeddded into the exe file when the solution is built. Is this so or can i update the app.config file for different situations without having to change code? Regards
-
Start up module for VB.NET Windows Application??AliAmjad Thanks, i do have a book and have seen the code you mention before. But for some reason it is not in my current form. When i select 'show all files' im the solution explorer, a plus sign appears next to my form which, if expanded, show me a Form.Designer.vb file and a Form.resx file. I can see some code with 'Mybase.Disposing' in the Form.Designer.vb file but cannot find the form constructor anywhere. I can create a constructor, with the same code as your comment and the IDE doesn't complain, but i would like to know why it is'nt there in the first place. I have also tried adding in another form, just in case the code was accidentily deleted but this was the same.
-
Start up module for VB.NET Windows Application??When i uncheck the 'Enable application framework' though what implication does this have?
-
Start up module for VB.NET Windows Application??I'm having difficulty finding the windows generated code. I can see the code from the forms designer but that does not contain the constructor.
-
Start up module for VB.NET Windows Application??In VB6 i used to start my project from a Sub Main() which resided in a module. This codei n sub main then initialised many things and called various forms, ie splash screen and so on. However i cannot get the VB.NET windows application to start in this way. The property settings require that the start up be a form, unless i use a different app type (ie console app or other). I'm new to VB.NET so would appreciate any best practice advise on this matter and how other developers are currently handling this. Many Thanks
-
Try Catch inside of functionsMany thanks , think i'll try applying the return at the end of the function.
-
Try Catch inside of functionsSome help on good practice would be appreciated. I have the following function and similar functions, but often get a squigly line somewhere in the functions which tells me the function does not return a value on all paths. Public Function ConvertToXmlDocument() As XmlDocument 'Alter the return type to suit - either stream or file or other Dim FileLineString As String Dim LineNumberInteger As Int32 Dim XmlSequenceCount As Int32 'Create xml envelope Dim XmlOutputDocument As New Xml.XmlDocument Try 'Intialise Xml Document If InitialiseXmlDocument(XmlOutputDocument, "Flat file" Then 'Loop array / reading each line of file content For Each FileLineString In Me.FileContentString 'Line count LineNumberInteger += 1 'Retrieve xml node....... 'Unformat retrieved node against file line.... Next Return XmlOutputDocument End If Catch ex As Exception Return Nothing End Try End Function Should i use multiple returns (ie another return statement after the end try) or is their a much better way in general, not just specific to this function? Many Thanks
-
ByRef the ByVal way ??Thanks, i'm currently upgrading from VB6 to .net and want to start off on a firm footing employing some good practices. I agree with Dave's response, anybody else with an opinion more than welcome though. Many Thanks
-
ByRef the ByVal way ??I have an XmlDocument (System.Xml) that i want to add to and do various other stuff but i want to split the routines down. I've read that ByVal is 'safer' to use and possibly quicker than byref so i am proposing to layout my functions as below... Imports System.Xml 'Declaration Dim XmlDocObject as New XmlDocument XmnlDocObject = InitialiseXml(XmlDocObject) Private Function InitialiseXml(ByVal v_XmlDocObject as XmlDocument) as XmlDocument 'Temp object Dim TempXmlObject = v_xmlDocObject 'Do something with temp object...... 'Return object now processing is finished Return TempXmlObject 'Destroy temp object TempXmlObject = Nothing End Function What i would like to know is if the above is good / bad practice? Anything thing wrong with this way? Is this the preferred way as opposed to using Byref or am i creating extra objects which will lie around in memory (until GC see fit to get rid)? Regards
-
Constant Module Or File ?:-DExcellent, thanks. Just the thing i was looking for.
-
Constant Module Or File ?When i first started VB6 i used to hard code constants into a separate Module. Then i moved on to using an ini file instead as this allowed me to change server paths and server names plus other info without the need for recompiling code. Now i'm onto and new to VB.NET i want to adopt a good practise and have started using an xml file instead which i then read into the application to initialise certain system properties. What i want to know is what other people are doing or is there a better standard that folks are using? Many Thanks
-
Enumerator Class helpGuy, Thanks alot - just needed a good example - could'nt see the Forest because the trees were in the way!!:-D Thanks
-
Enumerator Class helpI understand Polymorphism better than before because of your explanation, thanks. I am still confused how this applies to my Enums though. Do you have an exact example of how this would apply using enums? Thanks Ps:- To be honest what i was trying to do in the first place was probably bad practise, trying to put enums all in one place. I think as mentioned by someone ealrier they should be contained in each class.
-
Enumerator Class helpI do have a reasonable knowledge of OOP concepts and can understand why to put the enums into their respective classes, however i am a bit confused over the mention of polymorphism. I have read the link on Wiki. Can you elaborate further why i need to undertand polymorphism in this case for moving the enums into their own classes? Thanks
-
Enumerator Class helpThanks for the reponse. I had already created the class but in light of your reponses i think i'll dispose of it and follow a better practice after reading up a little. Cheers
-
Enumerator Class helpI want to create a class to hold the many enums i have created, instead of having them in various applications. I have need where somewhere where the class contents can be accessed without instantiating the class, for example. Instead of.... Dim EnumObject as New EnumeratorClass Dim Integer as int32 Integer = EnumObject.FileActionEnum.Open I want to do......... Imports SomeNamespace.EnumeratorClass (or something similar) Dim Integer as Int32 = EnumeratorClass.FileActionEnum.Open Can anybody give me a nudge in the right direction? (Yes i am new to VB.NET) Thanks
-
XFlatI'm currently on XP using VB.NET 2005. The organisation uses an older version of SAP which outputs flat files which need processing into other systems. I've looked at xsd validation which is useful for validatiing xml files and will be useful when we eventually upgrade SAP. However i need a generic way (or as much as possible) for reading from and creating flat files. I was wondering if there was a way of specifiying the structure of the flat files using xml files as some sort of schema. If not, is it possible i could de-serialise the flat files, maybe into objects and then later serialise them to (possibly) a different structured files? This is where i was wondering whether an xml type schema could be used. Any help, greatly appreciated.