By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,932 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,932 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.