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

Using a Reference in a Service

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


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

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

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

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

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

Replies have been disabled for this discussion.