Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > calling a class defined in an ASP.NET project from windows application

Reply
Thread Tools

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

 
 
z. f.
Guest
Posts: n/a
 
      06-10-2004
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.



 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-10-2004
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." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>



 
Reply With Quote
 
 
 
 
z. f.
Guest
Posts: n/a
 
      06-13-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
> >
> >
> >

>
>



 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-13-2004
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." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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." <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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.
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
z. f.
Guest
Posts: n/a
 
      06-13-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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." <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > 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.
> > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-13-2004
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." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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." <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > 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." <(E-Mail Removed)> wrote in message
> > > > news:(E-Mail Removed)...
> > > > > 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.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling instance method defined in a parent class ?? Christopher J. Bottaro Ruby 1 09-27-2007 01:03 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
#if (defined(__STDC__) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) Oodini C Programming 1 09-27-2005 07:58 PM
from base class calling methods defined in derived classes through pointer to member functions Luca C++ 2 12-19-2003 12:31 PM
Calling Windows application from Web application ASP .Net 1 11-02-2003 03:30 AM



Advertisments