Sharing a webreference across projects

S

Søren Reinke

Hi there

I have 1 solution (visual studio 2005) within this solution i have many
projects, they should all be able to have the same webreference to a
webservice.

But as far as i can figure out, i must have 1 webreference per project, and
not 1 for the whole solution.

How can i solve this ?
 
B

Bob Powell [MVP]

Add the same webreference to several projects. This works fine for me or am
I misunderstanding your question?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
S

Søren Reinke

Add the same webreference to several projects. This works fine for me or
am I misunderstanding your question?

That is exactly what i am trying to prevent.

We have about 40 different programs (aspx pages) that needs to talk to
different webservices, and also a few standalone applications. All in the
same solution.

I had hoped i could add the webreferences in 1 place, and then share them.

To do that i need to have them all in the same project ?
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You cannot do this, each project is an independent entity and needs to be
able to compile by itself. You will need to include the refeence in each
project.

cheers,
 
S

Søren Reinke

Ignacio Machin ( .NET/ C# MVP ) said:
Hi,

You cannot do this, each project is an independent entity and needs to be
able to compile by itself. You will need to include the refeence in each
project.

Hi there

Thanks for the claryfication.
 
G

Guest

One work around for this could be the following:

Create a code library (.NEt .dll) which serves as a wrapper for all of your
webservices. This way, you will only need to add a reference to a single
assembly in each of the projects requiring webservice access.

If not all applications use all of the webservices, you could create
multiple code libraries in which you logically group your webservices.

This also means that when you recompile your webservices, you will only need
to update the webservice references in one place.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top