473,418 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

calling a class defined in an ASP.NET project from windows application

Hi,

I'm working on a web project and i create classes to do business logic and
connect to DB.
i also need a windows application to do the same functionality as defined
in classes inside the ASP.NET project.
when i reference the web project DLL (inside the BIN directory) I
successfully make a call to a function and get return value.

but this is just a test and when trying to access the application
configuration information (defined in web.config) i get empty string in
return.

is there a way to share functionality between web and windows/service
projects?

TIA, zigi.

Nov 18 '05 #1
5 1553
Take you classes with business logic and data access into separate projects
in separate directories. They will compile to class libraries (assemblies).
Make another solution for the windows application and include the class
library projects there. You will have separate solutions for web and windows
applications sharing the same business and data access projects. In no way
your windows solution will need any access to web.config that belongs to
your web solution.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:Og*************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm working on a web project and i create classes to do business logic and
connect to DB.
i also need a windows application to do the same functionality as defined
in classes inside the ASP.NET project.
when i reference the web project DLL (inside the BIN directory) I
successfully make a call to a function and get return value.

but this is just a test and when trying to access the application
configuration information (defined in web.config) i get empty string in
return.

is there a way to share functionality between web and windows/service
projects?

TIA, zigi.

Nov 18 '05 #2
when i reference my web DLL form a Console application, the VIsual Studio
makes a copy of the Web DLL (that i referenced) in the bin directory of the
Console project.
what happend if i make changes to the web DLL?
will it not reference the correct location - just a copy?

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uO*************@TK2MSFTNGP10.phx.gbl...
Take you classes with business logic and data access into separate projects in separate directories. They will compile to class libraries (assemblies). Make another solution for the windows application and include the class
library projects there. You will have separate solutions for web and windows applications sharing the same business and data access projects. In no way
your windows solution will need any access to web.config that belongs to
your web solution.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:Og*************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm working on a web project and i create classes to do business logic and connect to DB.
i also need a windows application to do the same functionality as defined in classes inside the ASP.NET project.
when i reference the web project DLL (inside the BIN directory) I
successfully make a call to a function and get return value.

but this is just a test and when trying to access the application
configuration information (defined in web.config) i get empty string in
return.

is there a way to share functionality between web and windows/service
projects?

TIA, zigi.


Nov 18 '05 #3
What you call Web DLL is probably what I call class library and it is the
output of a separate project. Correct?
If you change it, the best advice is to rebuild your console solution. It
will pickup the changes and copy them into its bin directory.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
when i reference my web DLL form a Console application, the VIsual Studio
makes a copy of the Web DLL (that i referenced) in the bin directory of the Console project.
what happend if i make changes to the web DLL?
will it not reference the correct location - just a copy?

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uO*************@TK2MSFTNGP10.phx.gbl...
Take you classes with business logic and data access into separate

projects
in separate directories. They will compile to class libraries

(assemblies).
Make another solution for the windows application and include the class
library projects there. You will have separate solutions for web and

windows
applications sharing the same business and data access projects. In no way
your windows solution will need any access to web.config that belongs to
your web solution.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:Og*************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm working on a web project and i create classes to do business logic

and connect to DB.
i also need a windows application to do the same functionality as defined in classes inside the ASP.NET project.
when i reference the web project DLL (inside the BIN directory) I
successfully make a call to a function and get return value.

but this is just a test and when trying to access the application
configuration information (defined in web.config) i get empty string in return.

is there a way to share functionality between web and windows/service
projects?

TIA, zigi.



Nov 18 '05 #4
thanks, but i guess my question is how do i configure the second project to
use the DLL/class library from it's original location i know there is a way
to configure the dot.net about DLLs locations right?
thanks.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
What you call Web DLL is probably what I call class library and it is the
output of a separate project. Correct?
If you change it, the best advice is to rebuild your console solution. It
will pickup the changes and copy them into its bin directory.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
when i reference my web DLL form a Console application, the VIsual Studio
makes a copy of the Web DLL (that i referenced) in the bin directory of

the
Console project.
what happend if i make changes to the web DLL?
will it not reference the correct location - just a copy?

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uO*************@TK2MSFTNGP10.phx.gbl...
Take you classes with business logic and data access into separate

projects
in separate directories. They will compile to class libraries

(assemblies).
Make another solution for the windows application and include the class library projects there. You will have separate solutions for web and

windows
applications sharing the same business and data access projects. In no way your windows solution will need any access to web.config that belongs to your web solution.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:Og*************@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I'm working on a web project and i create classes to do business logic and
> connect to DB.
> i also need a windows application to do the same functionality as

defined
> in classes inside the ASP.NET project.
> when i reference the web project DLL (inside the BIN directory) I
> successfully make a call to a function and get return value.
>
> but this is just a test and when trying to access the application
> configuration information (defined in web.config) i get empty string in > return.
>
> is there a way to share functionality between web and

windows/service > projects?
>
> TIA, zigi.
>
>
>



Nov 18 '05 #5
Ok, there are 2 separate issues here.

1. Whether the dll is a part of your solution or no. You don't have to
include it in the solution as a project. You can add it as a .NET reference.
In the Add Reference dialog you will find a page for adding .NET references.

2. Whether to copy the dll locally into your solution's bin directory. You
will find this option in the reference properties dialog. This option is
available for both project and .NET references. If you set it to false, your
solution should access the dll at it's original location.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:ur**************@TK2MSFTNGP09.phx.gbl...
thanks, but i guess my question is how do i configure the second project to use the DLL/class library from it's original location i know there is a way to configure the dot.net about DLLs locations right?
thanks.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
What you call Web DLL is probably what I call class library and it is the
output of a separate project. Correct?
If you change it, the best advice is to rebuild your console solution. It will pickup the changes and copy them into its bin directory.

Eliyahu

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
when i reference my web DLL form a Console application, the VIsual Studio makes a copy of the Web DLL (that i referenced) in the bin directory
of the
Console project.
what happend if i make changes to the web DLL?
will it not reference the correct location - just a copy?

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uO*************@TK2MSFTNGP10.phx.gbl...
> Take you classes with business logic and data access into separate
projects
> in separate directories. They will compile to class libraries
(assemblies).
> Make another solution for the windows application and include the class > library projects there. You will have separate solutions for web and
windows
> applications sharing the same business and data access projects. In
no way
> your windows solution will need any access to web.config that
belongs
to > your web solution.
>
> Eliyahu
>
> "z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
> news:Og*************@TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > I'm working on a web project and i create classes to do business logic and
> > connect to DB.
> > i also need a windows application to do the same functionality as
defined
> > in classes inside the ASP.NET project.
> > when i reference the web project DLL (inside the BIN directory) I
> > successfully make a call to a function and get return value.
> >
> > but this is just a test and when trying to access the application
> > configuration information (defined in web.config) i get empty
string in
> > return.
> >
> > is there a way to share functionality between web and

windows/service > > projects?
> >
> > TIA, zigi.
> >
> >
> >
>
>



Nov 18 '05 #6

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

Similar topics

5
by: Paul | last post by:
OK...I must be missing something...can someone tell me what I'm not doing properly... First, create an assembly with a single interface in VB.NET as follow Public Interface IDo Function...
0
by: DraguVaso | last post by:
Hi, I made some application (VB.NET 2005) based on classes in Windows Forms. I made a new Class Library Project and copied all of my classes and modules in it, to make a DLL that I could import...
2
by: Tony Liu | last post by:
Hi, I want to get the name of the calling function of an executing function, I use the StackTrace class to do this and it seems working. However, does anyone think that there any side effect...
1
by: Nick Bishop | last post by:
I have a problem where I call a method in a C++ class with a pointer which is a static member in that class. When I use a debugger, I see the pointer having a certain value, but when I step into...
4
by: Tim Menninger | last post by:
Just started working on this and have not found any real good resources out there. We have a lot of native C++ Dll code that we use for our app. We want to share the code so that C# ASP.net code...
3
by: Gustavo L. Fabro | last post by:
Greetings! I'm a newbie in Visual C++ .NET (have programmed in Borland C++ and Builder for long) and I am trying to do a very simple thing, but I'm stuck. I created an (unmanaged) DLL project...
3
by: Dean Slindee | last post by:
I have a exception handling class that could be called from either a windows project app or a console project app. Is there any way for this class to determine which type of app called it without...
6
by: Amjad | last post by:
Hi, I want to make a project that calls and executes a function (VB code) made in a seperate file in the Application Folder. I know I can create the function in my project and call it internally,...
8
by: Derek Hart | last post by:
I am unclear about what all the requirements are to call a simple vb.net application, installed in the GAC, from COM (such as writing vba in Word to call the dotnet dll). I believe I have...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.