Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2004, 11:30 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a Class for multi projects

Hi,

I want to develop common classes (eg date conversion etc) thatI can use amongst different Windows and Web projects. I only want one copy of the source, not copied into different projects.

How can I do that? I would like to create their own namespaces so I can just import when required.

Thanks

Kerry O'Carroll
__________________
Kerry O\'Carroll
 
Old December 2nd, 2004, 01:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Create your class(es) and compile it(them) as a .dll, then you can add a reference to it from whichever project you want to.

J
 
Old December 2nd, 2004, 05:48 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How do I compile a class to .dll

I have a standard version on VB .Net version 1.1 - 2003

When I create a class, I have to open a project first. I know how to compile and run a windows project and also web projects.

Remember all I am trying to achieve is to use common routines across muliple projects (windows and web).

Thanks for your help

Kerry O'Carroll
 
Old December 3rd, 2004, 09:20 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any more advice please!!

Thanks

Kerry O'Carroll
 
Old December 4th, 2004, 11:27 AM
Authorized User
 
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create a new project of type Class Library and create the classes in this project. It will compile to a .dll that can be referenced in other projects.

I am not sure if Class Libraries are posisble in your version of VB .Net but I would not know why not

 
Old December 4th, 2004, 12:10 PM
Authorized User
 
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just found out the Class Library project type is not available in VB .NEt standard edition. So my previous post is not going to work.


 
Old December 4th, 2004, 05:13 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your advice.

Is there any way of sharing source code (class.vb) with more than one project. At teh moment I just copy between projects which has its dangers when I make a change.


Kerry O'Carroll





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help creating this Form with a backend Class iampedro ASP.NET 2.0 Basics 0 February 10th, 2007 05:26 PM
creating a .dll from a .cs class vb_developer C# 1 October 27th, 2004 05:59 PM
Using common .vb code in multi projects ocarroll .NET Framework 2.0 5 August 17th, 2004 04:38 PM
Design decision on class library projects? tkubaska BOOK: ASP.NET Website Programming Problem-Design-Solution 2 May 19th, 2004 11:43 AM
Need help creating reusable code in a class. jbenson001 ASP.NET 1.x and 2.0 Application Design 1 November 21st, 2003 01:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.