Results 1 to 4 of 4

Thread: [RESOLVED] VS 2005 "Class library" or "Console aplication" project?

  1. #1

    Thread Starter
    Addicted Member kutlesh's Avatar
    Join Date
    Jun 2018
    Location
    Skopje, Macedonia
    Posts
    211

    Resolved [RESOLVED] VS 2005 "Class library" or "Console aplication" project?

    I have lot of helper/utils functions which I use in several VB.NET projects. I want to build at least one VB.NET module which I will use, develop, maintain, test, debug and it will be same for all of my VB.NET projects.

    However, using a class library might not be the best idea because I don't know how to test my code. There is no executable or either testing framework in VS 2005 where I can develop code tests for my utility functions.

    Is Console Application a better choice where I can run and create manually code tests for my utility functions?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VS 2005 "Class library" or "Console aplication" project?

    Your utility types and members should be in a DLL, so a class library. If you're unable to create proper unit tests, add another project to the same solution to act as a test rig. That would be an EXE of some sort, whether Console or WinForms or whatever.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member kutlesh's Avatar
    Join Date
    Jun 2018
    Location
    Skopje, Macedonia
    Posts
    211

    Re: VS 2005 "Class library" or "Console aplication" project?

    Hmm, a good answer there but now I don't know how to add my utils project as a reference to my testing project. I don't see "*.vbproj" in Projects tab(Add Reference Dialog).

    Do I need to do something to see my utils project listed in add reference?
    Or what should I do to add it?

    Or just add the compiled dll from the other project?
    Last edited by kutlesh; Mar 4th, 2019 at 07:17 AM.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] VS 2005 "Class library" or "Console aplication" project?

    Normally you would just reference the compiled DLL but, if you really want to be able to debug the library project in other solutions (which should not be required if your test rig is doing its job) then you can always add an existing project to a new solution. Your library project will then be included in multiple solutions, even though there's only one copy of the code. The SLN file contains the path of each VBPROJ file in that solution and, when you add a new project each time, those project files are under the solution folder by default, but they can be anaywhere.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

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