Wrox Programmer Forums
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 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 February 24th, 2005, 03:52 AM
Authorized User
 
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Include files" in VB.net

Hi there !

I have a VB.net application ("MyApp") who needs to use code stored in another folder, where I have (common) procedures used by lots of other projects. I don't want to copy those in my particular app's folder, but I would like to include them in my Solution and compile them at compile time.

I tried to do this by building a Solution with 2 Projects, "Common" and "MyApp", and compile the Projects in the correct order - first Common, and then MyApp. IT DOESN'T WORK !

Any call from MyApp of a procedure stored in Common generates an error; any reference to a data type defined in Common generates an error... etc. MyApp doesn't "see" Common, as if they were 2 completely separate entities.

So how do I do this in VB.net ?

TIA


 
Old February 24th, 2005, 04:06 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

You have to add references to the Common Project in MyApp.Include the dll in the MyApp using Add References in VS.NET

 
Old February 24th, 2005, 05:57 AM
Authorized User
 
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, but it's not a DLL. It's just plain simple source code (.vb file), and, if possible, I would like to keep it that way.

VB6 could do this easily ! You tell me VB.net can't ?! Argggh ! :-)


 
Old February 24th, 2005, 10:44 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

You have the common.vb file in separate project right.If it so,you have to build it and add an reference to the MyApp project.
Include the namespace of the common.vb in your MyApp files whereever you want to use and access the procedure.
(eg)If common.vb is in Common.Web namespace
import it into your MyApp file like imports Common.Web
The procedures inside the common.vb will be accessible now to your MyApp file.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Include files tarang SQL Server 2000 1 July 18th, 2007 03:32 AM
Execute VBS files via ASP.NET (VB.NET) Mario_Steiner ASP.NET 1.0 and 1.1 Professional 0 November 9th, 2005 07:49 AM
Equivalent to include files in VB Access jrwlkn Access 2 January 15th, 2004 01:50 PM
ADO.net + include files eddiema ADO.NET 3 December 12th, 2003 03:43 AM





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