473,394 Members | 1,740 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,394 software developers and data experts.

Using a Reference in a Service

I am creating a windows service and have added a reference to a DLL project
that I have created. That DLL file is correctly referenced in both a
windows app and a web app, all in the same solution, so I thought I could do
the same for a service project. However, after successfully adding the
reference and making sure the namespaces were correct, I cannot see any of
my public methods and functions from the DLL file.

Is there anything special that must be done to permit reference members to
be seen in a function? Thanks so much!

Derek

--
Derek Martin
593074
Nov 21 '05 #1
5 1644
Do references in Windows Service applications just not work?
"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am creating a windows service and have added a reference to a DLL project
that I have created. That DLL file is correctly referenced in both a
windows app and a web app, all in the same solution, so I thought I could
do the same for a service project. However, after successfully adding the
reference and making sure the namespaces were correct, I cannot see any of
my public methods and functions from the DLL file.

Is there anything special that must be done to permit reference members to
be seen in a function? Thanks so much!

Derek

--
Derek Martin
593074

Nov 21 '05 #2
Derek,
A windows app, a web app & a windows service all "reference" a DLL project
in the same manner, what is visible to one, must be visible to the others.

It sounds like you have something else confused. As all four in the same
solution? Do the first three reference the DLL Project itself or the DLL
directly. I normally reference the DLL Project. Are you using VS.NET 2002,
VS.NET 2003 or the VS.NET 2005 beta?

I have a number of Windows Services that reference DLL projects within the
same solution & haven't had any problems yet...

Hope this helps
Jay

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
Do references in Windows Service applications just not work?
"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am creating a windows service and have added a reference to a DLL
project that I have created. That DLL file is correctly referenced in
both a windows app and a web app, all in the same solution, so I thought I
could do the same for a service project. However, after successfully
adding the reference and making sure the namespaces were correct, I cannot
see any of my public methods and functions from the DLL file.

Is there anything special that must be done to permit reference members
to be seen in a function? Thanks so much!

Derek

--
Derek Martin
593074


Nov 21 '05 #3
Hey Jay, I reference the project. Using 2k3 version. Here's what I found
out...
The projects must be in different namespaces - doink. My windows app uses
the namespace clue, my web app uses the namespace clue, my dll project uses
the namespace clue, but my windows service cannot apparently use the
namespace clue. Once I changed the namespace in the windows service project
to something other than clue, it worked just fine...is that odd or what!?

Oh well,

Derek

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Derek,
A windows app, a web app & a windows service all "reference" a DLL project
in the same manner, what is visible to one, must be visible to the others.

It sounds like you have something else confused. As all four in the same
solution? Do the first three reference the DLL Project itself or the DLL
directly. I normally reference the DLL Project. Are you using VS.NET 2002,
VS.NET 2003 or the VS.NET 2005 beta?

I have a number of Windows Services that reference DLL projects within the
same solution & haven't had any problems yet...

Hope this helps
Jay

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
Do references in Windows Service applications just not work?
"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am creating a windows service and have added a reference to a DLL
project that I have created. That DLL file is correctly referenced in
both a windows app and a web app, all in the same solution, so I thought
I could do the same for a service project. However, after successfully
adding the reference and making sure the namespaces were correct, I
cannot see any of my public methods and functions from the DLL file.

Is there anything special that must be done to permit reference members
to be seen in a function? Thanks so much!

Derek

--
Derek Martin
593074



Nov 21 '05 #4
Derek,
I normally set each project to a unique Namespace, that share a root
namespace.

Something like:
Windows App: MyCompany.Clue.Manager, MyCompany.Clue.UI or even
MyCompany.Clue.Manager.UI
Web App: MyCompany.Clue.Manager or MyCompany.Clue.UI
Windows Service: MyCompany.Clue.Service
DLL Project (domain/business objects): MyCompany.Clue.Domain or even
just MyCompany.Clue
DLL Project (data objects): MyCompany.Clue.Data
DLL Project (utility objects): MyCompany.Clue.Framework or even just
MyCompany.Clue (if there are not domain/business objects).

Having the namespace the same, should not matter (as evidenced by the DLL &
windows app working). I suspect you have something else going on:
- Do you have a class named the same as a namespace? Such as the Service
itself (the class that inherits from ServiceBase) is called Clue? You should
avoid naming classes & namespaces the same, especially when they are nested,
as this causes ambiguities for the compiler.

- Do you include the Namespace statements in one project, while the other
projects do not? I normally set the root namespace for the Project (as
identified above) in the Project Properties, then I use Namespace statements
when I have a group of types in that project that I want to be qualified.

- Something else?

Note I modified one of my projects so the Windows Service root namespace
matches a referenced DLL Project's root namespace. It finds all the needed
classes...

Hope this helps
Jay

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hey Jay, I reference the project. Using 2k3 version. Here's what I found
out...
The projects must be in different namespaces - doink. My windows app uses
the namespace clue, my web app uses the namespace clue, my dll project
uses the namespace clue, but my windows service cannot apparently use the
namespace clue. Once I changed the namespace in the windows service
project to something other than clue, it worked just fine...is that odd or
what!?

Oh well,

Derek

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Derek,
A windows app, a web app & a windows service all "reference" a DLL
project in the same manner, what is visible to one, must be visible to
the others.

It sounds like you have something else confused. As all four in the same
solution? Do the first three reference the DLL Project itself or the DLL
directly. I normally reference the DLL Project. Are you using VS.NET
2002, VS.NET 2003 or the VS.NET 2005 beta?

I have a number of Windows Services that reference DLL projects within
the same solution & haven't had any problems yet...

Hope this helps
Jay

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
Do references in Windows Service applications just not work?
"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am creating a windows service and have added a reference to a DLL
project that I have created. That DLL file is correctly referenced in
both a windows app and a web app, all in the same solution, so I thought
I could do the same for a service project. However, after successfully
adding the reference and making sure the namespaces were correct, I
cannot see any of my public methods and functions from the DLL file.

Is there anything special that must be done to permit reference members
to be seen in a function? Thanks so much!

Derek

--
Derek Martin
593074



Nov 21 '05 #5
Ambiguousness appears to be what I had - I have since gone through as you
suggested and set up a root namespace and drilled down from there in the
various classes, etc. That did it! Thank you so much!!!!!
:-)

Derek
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uF**************@TK2MSFTNGP12.phx.gbl...
Derek,
I normally set each project to a unique Namespace, that share a root
namespace.

Something like:
Windows App: MyCompany.Clue.Manager, MyCompany.Clue.UI or even
MyCompany.Clue.Manager.UI
Web App: MyCompany.Clue.Manager or MyCompany.Clue.UI
Windows Service: MyCompany.Clue.Service
DLL Project (domain/business objects): MyCompany.Clue.Domain or even
just MyCompany.Clue
DLL Project (data objects): MyCompany.Clue.Data
DLL Project (utility objects): MyCompany.Clue.Framework or even just
MyCompany.Clue (if there are not domain/business objects).

Having the namespace the same, should not matter (as evidenced by the DLL
& windows app working). I suspect you have something else going on:
- Do you have a class named the same as a namespace? Such as the Service
itself (the class that inherits from ServiceBase) is called Clue? You
should avoid naming classes & namespaces the same, especially when they
are nested, as this causes ambiguities for the compiler.

- Do you include the Namespace statements in one project, while the other
projects do not? I normally set the root namespace for the Project (as
identified above) in the Project Properties, then I use Namespace
statements when I have a group of types in that project that I want to be
qualified.

- Something else?

Note I modified one of my projects so the Windows Service root namespace
matches a referenced DLL Project's root namespace. It finds all the needed
classes...

Hope this helps
Jay

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hey Jay, I reference the project. Using 2k3 version. Here's what I
found out...
The projects must be in different namespaces - doink. My windows app
uses the namespace clue, my web app uses the namespace clue, my dll
project uses the namespace clue, but my windows service cannot apparently
use the namespace clue. Once I changed the namespace in the windows
service project to something other than clue, it worked just fine...is
that odd or what!?

Oh well,

Derek

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Derek,
A windows app, a web app & a windows service all "reference" a DLL
project in the same manner, what is visible to one, must be visible to
the others.

It sounds like you have something else confused. As all four in the same
solution? Do the first three reference the DLL Project itself or the DLL
directly. I normally reference the DLL Project. Are you using VS.NET
2002, VS.NET 2003 or the VS.NET 2005 beta?

I have a number of Windows Services that reference DLL projects within
the same solution & haven't had any problems yet...

Hope this helps
Jay

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
Do references in Windows Service applications just not work?
"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
>I am creating a windows service and have added a reference to a DLL
>project that I have created. That DLL file is correctly referenced in
>both a windows app and a web app, all in the same solution, so I
>thought I could do the same for a service project. However, after
>successfully adding the reference and making sure the namespaces were
>correct, I cannot see any of my public methods and functions from the
>DLL file.
>
> Is there anything special that must be done to permit reference
> members to be seen in a function? Thanks so much!
>
> Derek
>
> --
> Derek Martin
> 593074
>



Nov 21 '05 #6

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

Similar topics

2
by: Michael Barrido | last post by:
Greetings! I have a project that needs to access a web service. My problem is this web service is provided via CGI. I cannot do a "Web Reference" to it to add in my dotnet project. I'm planning to...
2
by: Faraz | last post by:
I would be also interested in knowing if there a way to make a proxy for a web service at runtime - the web service not existant when execution starts -. Let me explain. My executable starts...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
5
by: Trevor Andrew | last post by:
Hi There I am having some difficulty referencing Web Services. I am using Visual Studio .NET 2003, with the .NET Framework 1.1, and trying to write a VB.NET Windows Application that consumes an...
1
by: rgarf | last post by:
I have a web service that is consumed by a C++ application. I added a C# dll reference to the web service, When the web service calls a method on the dll, it sends back an HRESULT of E_FAIL to my...
3
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
9
by: Davidhere40 | last post by:
Do I have to use a web reference to access use a remote web reference? I can't seem to just use the proxy generated by my web services project, because that one never calls the remote service, its...
3
by: Mike | last post by:
I have a web app that is referencing several web services. When I make a change to a web service (add, modify a method), I have to 'Add Web Reference' for the changes to take affect. If I do 'Update...
4
by: Spam Catcher | last post by:
Hi all, I'm building a multi-tier web application that is primarily driven by a web service back end. Are there any configuration settings I should know about to increase the performance of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.