473,770 Members | 4,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1576
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******** *****@TK2MSFTNG P10.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.co m> wrote in message
news:uO******** *****@TK2MSFTNG P10.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******** *****@TK2MSFTNG P10.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******** ******@TK2MSFTN GP09.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.co m> wrote in message
news:uO******** *****@TK2MSFTNG P10.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******** *****@TK2MSFTNG P10.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.co m> wrote in message
news:u1******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP09.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.co m> wrote in message
news:uO******** *****@TK2MSFTNG P10.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******** *****@TK2MSFTNG P10.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******** ******@TK2MSFTN GP09.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.co m> wrote in message
news:u1******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP09.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.co m> wrote in message
news:uO******** *****@TK2MSFTNG P10.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******** *****@TK2MSFTNG P10.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
2195
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 Bark(ByVal lVolume As Long) As Strin End Interfac Pretty simple..
0
386
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 afterwarths in Windows Forms applciations. The problem is that I get several errors indication that some methods aren't declared or defined when I try to build the project...
2
9783
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 towards this approach such as how would it works in multi-thread. Thanks Tony
1
1917
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 the method (F11), the pointer has a different value and is not pointing at anything valid. The small program (complete source below) demonstrates what I am trying to achieve. The small program works perfectly, but when I incorporate this logic...
4
9879
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 can use the same business logic as our C++ client. Here are some questions: 1) Is there a way to call into native C++ classes directly? Meaning we do not have C API. I believe we could use a C API using the in C#. 2) If can't do #1, do we need...
3
2717
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 with a sample function, and tried to call it from a ".NET Forms" project. All I get are "Unresolved External" errors from the Linker!
3
1968
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 sending an window/console parameter from either app? Thanks, Dean Slindee
6
1709
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, but I want to put the function's code in an external file, so that future updates to the function will require a replacing the function file instead of re-installing the whole project. Can you give me ideas on how I can make small updates to my...
8
1990
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 installed the dll in the GAC. It is in there and has a public token. I did not create a key-value pair. I believe it is strong named, as it shows up in the GAC. How do I browse the objects of it? I would like to call it late bound, but the errors I...
0
10237
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
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,...
1
7431
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
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
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
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.