473,799 Members | 3,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Projects, single code file

Within ASP.NET, is it possible to use a single .vb file and have it shared
(or accessed) between multiple projects without having that file being
copied to each project folder?

ie.
C:\Projects\MyP roject1 (project 1)
C:\Projects\MyP roject2 (project 2)
C:\Projects\Com monFiles\MyComm onFile.vb (common file directly accessed
and compiled from Project1 and Project2)

The error that I get when manually editing the project file to do this is:
"The file '...{filename}' could not be added to hte project. The specified
path contains invalid characters, is an absolute path, or is a path outside
of the project directory."

I realize that another option would be to take what is in "CommonFile s" and
compile that into its own assembly, then reference that assembly between the
2 projects. But, I would like to explore the option of having each project
point to a common file and include that code into each compiled assembly
first.

Thanks,
Jody
Nov 19 '05 #1
1 2085
What you need to do is compile
MyCommonFile.vb and place it in the GAC.

There it will be available to all applications.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espańol
Ven, y hablemos de ASP.NET...
=============== =======

"Jody Gelowitz" <jg************ **@blah.leevall ey.com> wrote in message
news:u5******** ******@TK2MSFTN GP10.phx.gbl...
Within ASP.NET, is it possible to use a single .vb file and have it shared
(or accessed) between multiple projects without having that file being
copied to each project folder?

ie.
C:\Projects\MyP roject1 (project 1)
C:\Projects\MyP roject2 (project 2)
C:\Projects\Com monFiles\MyComm onFile.vb (common file directly accessed
and compiled from Project1 and Project2)

The error that I get when manually editing the project file to do this is:
"The file '...{filename}' could not be added to hte project. The
specified path contains invalid characters, is an absolute path, or is a
path outside of the project directory."

I realize that another option would be to take what is in "CommonFile s"
and compile that into its own assembly, then reference that assembly
between the 2 projects. But, I would like to explore the option of having
each project point to a common file and include that code into each
compiled assembly first.

Thanks,
Jody

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1995
by: Hamed | last post by:
Hello Every where in .NET books is mentioned that VS.NET is a seamless cross platform environment. We have two groups of programmers that some are VB programmer but others prefer to use C#. Is it possible to have a project that accepts both kind of sources? I mean for example one class is in VB.NET and the other in C#. Then one can trace or debug a mixed code that switches between several languages code. In general when I want to create a...
2
2474
by: Mark | last post by:
Is there a realistic way for some developers on our team to work with multiple projects in a single solution under VSS source control, and have other developers only working with a single project from the solution? Thanks in advance. Mark
3
2582
by: Harry Whitehouse | last post by:
I'm developing a small class which will be used in a number of distinct C# projects. This small class is undergoing constant change/refinement as I try to employ it in the different projects. I'm trying to maintain a *single* copy of the CS file that can be used in the multiple .NET projects. But I'm observing that when you add a CS file to a given .NET project, subsequent modifications to that file are only saved in the current...
3
2216
by: Carl Johansen | last post by:
I have a big ASP website (used by several thousand car dealers) that is a collection of lots of small and medium-sized applications. Now I want to start adding ASP.NET applications to it. I have read Q307467 (How To Create an ASP.NET Application from Multiple Projects for Team Development) and it seems to work well. I understand that when you create a web project in VS.NET, it creates an IIS application root, and that you can remove this...
6
1235
by: UJ | last post by:
I have a couple of files (type definitions, constants, ...) that I want to use in multiple projects. How do I make it so that I have only one copy of the file for multiple projects? If I do add existing to a project, it copies the file to the project directory. I'd like to have a single directory (called something like library) that has all the common source code in it that then gets referenced from the projects. TIA. Jeffrey.
1
2145
by: David Herbst | last post by:
I have a solution that contains one main web project, ten sub web projects and a controls library project all in a single web application. I followed the steps in the following MS KB: How To Create an ASP.NET Application from Multiple Projects for Team Development http://support.microsoft.com/default.aspx?scid=kb;en-us;307467 e.g. http://localhost/application1 (references project sharedcontrols, module1, module2)
10
3778
by: eswanson | last post by:
I have broken up my web site into smaller web site projects. When I look at the precompiled files, it always has the virtual directory in them ie: <preserve resultType="3" virtualPath="/Security/DefaultLogin.aspx" hash="fde4916e6" filehash="ffffe84d717a4765" flags="110000" assembly="App_Web_-xo1n4yg" type="ASP.defaultlogin_aspx"> <filedeps> <filedep name="/Security/DefaultLogin.aspx" /> </filedeps> </preserve>
3
2081
by: Claudio Pacciarini | last post by:
Hi everyone, I have a question about .NET code sharing and reuse, and also about application design best practices / guidelines. Currently, we have many different .NET projects in source depot. Although they are different, in some of them we share C# code by referencing source files that are external (not part of the projects) on each project. For instance, some of our projects have the typical “sources” file with:
2
8157
by: Jonathan Kacprowicz | last post by:
I am trying to create a build process using MSBuild that will build my multiple projects all with the same AssemblyVersion and AssemblyFileVersion. I have tried using the AssemblyInfo task from the community tasks projects (http://msbuildtasks.tigris.org/) and the AssemblyInfoTask from the MSBuild blog (http://www.gotdotnet.com/codegallery/codegallery.aspx?id=93d23e13-c653-4815-9e79-16107919f93e). My scenario is this: I have several...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10219
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10025
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6804
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.