Skip to content

VB.Net Sharing a Single copy of a source file

Lawrence Sall

Asked Sep 13, 2008, 7:55 AM EDT1 answer
Share
LinkedInX
Hello all. I'm new here and been trying to get an answer on this rather basic question.

I have a VB6 project group, in that group I have two projects a testing project and the class project.  I have a single source file shared between them call MiscUtils.bas.  In VB6 I could edit that module and both projects were kept in sync with the changes.  Also this same module is used by twenty other projects and still there is only 1 MiscUtils.bas on my computer.

Now that I have joined the ranks of .Net it seems that this is not possible. I have the VB.Net Express 2008. Every project seems to for some reason get it's own independent copy of MiscUtil.vb.  I seem to have this happen even if I specifically add the module from within the project as an existing module.  I see a copy of the source in the project folder and changes I make in one project do not appear when I open a different project using that same .vb source file.

It's really a pain to adjust one of the routines for VB.Net and then must remember all the projects that are currently using the file and then update each. 

Ok I had it suggested to make a Class out the the routines.... Sometimes the overhead hit makes this approach not so good.  I have code that users complain about hung systems and reboot if response is not instant.  Often the code I run is against 500+ records and on 15 fields of validation with External Web access on each record.  A moving progress bar still does not help.  So every millisecond I can save helps.  In some projects I actually include the classes I would normally have used via a DLL just to save execution time. I certainly do not want to use outdated code for those classes just because I forgot to copy the class to the project folder on the other apps that use it.  Same goes for modules.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    +1
    In the dotnet each application or process is divided to several AppDomains, To clarify the appdomain concept I can say that they could be considered as sub processes, the problem with those last ones is that they are isolated each from the other so that if an appdomain falls it doesn't cause the entire application to fall, in the other hand it is used for security issues. Never the less There is a solution for your problem is that you make use of the Bridge pattern, it is the ideal solution for your case, it is used in the dotnet univer and java univer to update and extend existing applications composed from more than one component
    +1