[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

problem referncing common assemblies from several WS projects (NO GAC!

raniz

8/3/2003 4:43:00 PM

Hello

My problem is with being able to reference some common assemblies from
several different WEB SERVICE projects WITHOUT registering these assemblies
in the GAC.

The problem stems from the fact that a web service project demands
Assemblies referenced by it to be copied into its directory - usually the
"bin" directory under the iis application. and that requires me to duplicate
these common assemblies in each project, which raises the problem of keeping
them updated (as opposed to winform application that allows referencing
without local copy.

Consideration for this architecture are:
1. I would like to split the services between several dlls in order to gain
better survivability for the services.
2. I would like to avoid using the GAC because of deployment (and team
development) difficulties, and enjoy x-copy capabilities.
3. The common assemblies are to be used not only by the web services but
also by other winforms applications that add their path in compilation
(therefore have no "WS style" problems).

Does anyone have a suggestion? is it possible at all?

Tnx Rani



2 Answers

Jay B. Harlow [MVP - Outlook]

8/3/2003 5:54:00 PM

0

Raniz,
In my WinForm application I call AppDomain.AppendPrivatePath to add
additional paths to search to load assemblies. I use this to get better
organization of the support dlls for the application.

My directory structure looks similar to:
\program files\my app\my app.exe
\program files\my app\plugins\plugin1.dll
\program files\my app\plugins\plugin2.dll
\program files\my app\bin\framework.dll

My sub main is similar to:
Public Shared Sub Main()
AppDomain.CurrentDomain.AppendPrivatePath("bin")
AppDomain.CurrentDomain.AppendPrivatePath("plugins")

Application.Run(new MainForm)
End Sub

For WinForms it work great, I have not tried it from a web app. I would
think if you copied your common dlls to a common folder, then gave each web
app access to this common folder (virtual folder in app maybe?) Not sure how
I would specifically implement this in ASP.NET, but it may give you ideas.
Also not sure of security issues, for my WinForms app, all the folders are
children of the main executables folder...

I have only used this in VS.NET 2003 (.NET 1.1). I would expect it to also
work in VS.NET 2.002 (.NET 1.0).

Hope this helps
Jay


"raniz" <raniz@pos.co.il> wrote in message
news:%23rla2XdWDHA.2424@TK2MSFTNGP12.phx.gbl...
> Hello
>
> My problem is with being able to reference some common assemblies from
> several different WEB SERVICE projects WITHOUT registering these
assemblies
> in the GAC.
>
> The problem stems from the fact that a web service project demands
> Assemblies referenced by it to be copied into its directory - usually the
> "bin" directory under the iis application. and that requires me to
duplicate
> these common assemblies in each project, which raises the problem of
keeping
> them updated (as opposed to winform application that allows referencing
> without local copy.
>
> Consideration for this architecture are:
> 1. I would like to split the services between several dlls in order to
gain
> better survivability for the services.
> 2. I would like to avoid using the GAC because of deployment (and team
> development) difficulties, and enjoy x-copy capabilities.
> 3. The common assemblies are to be used not only by the web services but
> also by other winforms applications that add their path in compilation
> (therefore have no "WS style" problems).
>
> Does anyone have a suggestion? is it possible at all?
>
> Tnx Rani
>
>
>


Christian Kuendig

8/4/2003 8:36:00 PM

0

Hi Rani,

Well, maybe the thing with the local copy (private assembly) isn't that bad
considering the fact that you have several clients maybe referencing
different versions of your common.dll which I suppose contains your
interfaces.
In case that thing is strong named you will run into tricky scenarios
because side-by-side execution kind of asks for the GAC doesn't it? If it's
not strong named, in the other hand, you can break clients while changing
the common and not recompiling them all. Well, you can argue, that's anyway
the case when they want to contact the "server" which was compiled against
the new common.dll... well, that's true, but just the next problem to solve.
Maybe it's required to design new versions of the interfaces in such a way
that they are compatible with lower versions.

Anyway, suppose to use a not strongly named, locally copied, private
assembly:.
Keeping them updated could be as easy as:
- adding the common project into the different solutions and referencing the
common project from the projects that consume it.
- additionally I suggest to set the build property for the common project to
false for all those solutions that just consume the dll. Now it should
automatically be copied to the local directory which should be the /bin for
asp.net. In addition, when you recompile the solution it copies the current
version locally which should solve your problem and enable you to xcopy
everything.

specifying additional private assembly paths shouldn't work because in the
MSDN it's written, that those paths must be subdirectories of the
application base. Which you might or might not manage to be like that, but I
wouldn't if you have winforms and asp apps.


regards

Christian

--
..NET Competence Centre - HSR University, Switzerland

"raniz" <raniz@pos.co.il> schrieb im Newsbeitrag
news:%23rla2XdWDHA.2424@TK2MSFTNGP12.phx.gbl...
> Hello
>
> My problem is with being able to reference some common assemblies from
> several different WEB SERVICE projects WITHOUT registering these
assemblies
> in the GAC.
>
> The problem stems from the fact that a web service project demands
> Assemblies referenced by it to be copied into its directory - usually the
> "bin" directory under the iis application. and that requires me to
duplicate
> these common assemblies in each project, which raises the problem of
keeping
> them updated (as opposed to winform application that allows referencing
> without local copy.
>
> Consideration for this architecture are:
> 1. I would like to split the services between several dlls in order to
gain
> better survivability for the services.
> 2. I would like to avoid using the GAC because of deployment (and team
> development) difficulties, and enjoy x-copy capabilities.
> 3. The common assemblies are to be used not only by the web services but
> also by other winforms applications that add their path in compilation
> (therefore have no "WS style" problems).
>
> Does anyone have a suggestion? is it possible at all?
>
> Tnx Rani
>
>
>