Possible to have common assembly dir w/o GAC?

D

Dave Kolb

Hi,

It is possible to reference an assembly in a directory other than in the bin
subdir without registering in ghe GAC?

For instance, I would love to have all my web apps on one server reference
assemblies from a c:\inetpub\wwroot\common directory shared by the apps on
that web server.

Thanks for any ideas.

Dave
 
J

John Timney \(Microsoft MVP\)

If the DLL(s) was thread safe, you could probably create an instance of your
object(s) in the global.asax application_onstart event
and place that object in an application variable. Then all web pages have
access to it as they do to the application objects.

This isn't however a recommended approach and you should use the GAC or
replicate your DLL.


--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
----------------------------------------------------------------------------
------------------------------------
<blatant plug>
Professional .NET for Java Developers with C#- ISBN: 1-861007-91-4
Professional Windows Forms - ISBN: 1861005547
Professional JSP 2nd Edition - ISBN: 1861004958
Professional JSP - ISBN:
1861003625
Beginning JSP Web Development - ISBN: 1861002092
</blatant plug>
 
D

Dave Kolb

What about creating a junction point for each web app that wants to use a
common assembly dir higher up the root using the linkd.exe and then using a
<probing> directive somehow? What are the asp.net runtime rules for locating
assemblies?

Any reason it would not be a nice future asp.net feature to allow a
web.config to reference a common assembly dir to load from without resorting
to the complications of strong names and GAC registration?

Thanks,
Dave
 
D

Dave Kolb

This seems to work fine:

1. cd c:\inetpub\wwwroot\myapp
2. do a "linkd bin2 c:\inetpub\wwwroot\common"
3. put needed modules in the common dir.
4. Add the following to web.config for the app and the app runs with them
and fails if they are not there.
<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<probing privatePath="bin2"/>

</assemblyBinding>

</runtime>
 
J

John Timney \(Microsoft MVP\)

Sounds like you have a solution ..............

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
----------------------------------------------------------------------------
------------------------------------
<blatant plug>
Professional .NET for Java Developers with C#- ISBN: 1-861007-91-4
Professional Windows Forms - ISBN: 1861005547
Professional JSP 2nd Edition - ISBN: 1861004958
Professional JSP - ISBN:
1861003625
Beginning JSP Web Development - ISBN: 1861002092
</blatant plug>
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top