CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2001
    Posts
    1,447

    is common code possible in vb.net ?

    Tried a forum search ... no joy.

    I have multiple applications and a handful of funcs and subs that I use in many of them and I want to put those in ONE module and have that module used by all of the apps at compile time. Problem is, when I do that, it just copies the "common" module to the app folder and any changes I make happen THERE, and do not propagate back to the actual common module. That is, I can START with a common module but it doesn't stay common, so it actually ISN'T common in any formal sense of the word.

    Is there anything I can do ?

    Thanks
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  2. #2
    Join Date
    Aug 2005
    Posts
    198

    Re: is common code possible in vb.net ?

    Certainly:

    Project -> Add Existing Item -> Add as Link (you have to click the button drop-down - a bad interface for sure).
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

  3. #3
    Join Date
    Feb 2011
    Location
    DeLand, FL
    Posts
    41

    Re: is common code possible in vb.net ?

    I have a utility project that I include in all of my projects that does just what you're describing. It exists as a separate project and compiles down to its own DLL. Whenever I create a new project I just include the utility project as part of the solution. No special tricks. I'm using C# for all my work now but I know you can do exactly the same thing in VB.Net.

    -Max

  4. #4
    Join Date
    Aug 2001
    Posts
    1,447

    Re: is common code possible in vb.net ?

    Quote Originally Posted by David Anton View Post
    Certainly:

    Project -> Add Existing Item -> Add as Link (you have to click the button drop-down - a bad interface for sure).
    Excellent --- just what I was looking for. I really appreciate it.
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  5. #5
    Join Date
    Aug 2001
    Posts
    1,447

    Re: is common code possible in vb.net ?

    Quote Originally Posted by Max Peck View Post
    I have a utility project that I include in all of my projects that does just what you're describing. It exists as a separate project and compiles down to its own DLL. Whenever I create a new project I just include the utility project as part of the solution. No special tricks. I'm using C# for all my work now but I know you can do exactly the same thing in VB.Net.

    -Max
    Yeah, thanks for the suggestion, and that would have been my fall-back position but I like the "add as link" a lot better.
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  6. #6
    Join Date
    Feb 2011
    Location
    DeLand, FL
    Posts
    41

    Re: is common code possible in vb.net ?

    Quote Originally Posted by phinds View Post
    Yeah, thanks for the suggestion, and that would have been my fall-back position but I like the "add as link" a lot better.
    No problem. That does sound like it would work better in your situation (a module with functions in it). In my case I've got a number of different class modules in the utility project. Including the project let's me continue to develop them as I develop the project - the changes are immediately available in all other projects.

    L8R! :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured