Groups > Asp .Net > VS 2005 Web Application Projects > Re: using a custom bin directory for references in a web app




using a custom bin directory for references in a web app

using a custom bin directory for references in a web app
Thu, 13 Mar 2008 23:11:02 +000
Hi

I created a web services project and I reference dlls from a folder called
"c:\Program Files\xxx". When I compile the project the referenced dll
gets copied to the bin directory of the web services project. Now if I modify
the dll in the "c:\Program Files\xxx" folder then I would have to
manually copy over the dll to the web services bin directory in case I don't
want to recompile the web services project. 

I don't want to recompile the web services project each time and I know that the
dll in the "c:\Program Files\xxx" folder will be changing regularly
and I don't want to manually copy it over to the web services bin directory each
time. What is a way that I can go about telling my web services application to
look for the dll in the "c:\Program Files\xxx" directly? As far as I
could tell the web config <probing> element only works for sub directories
and I think that the <runtime> wouldn't be good since I would need to
specify version in that and that would be pointless because the whole reason why
I am trying to do this is because I know that the version of the referenced
assembly will change and I don't want to go update anything once it does.

Any ideas on doing this are more than welcome.

Thanks

 Sumeet
Post Reply
Re: using a custom bin directory for references in a web app
Thu, 13 Mar 2008 23:30:28 +000
Use GAC, it will solve your problem.

see url how to use GAC

http://www.devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=106
Post Reply
Re: using a custom bin directory for references in a web app
Thu, 13 Mar 2008 23:46:19 +000
Hi

Thanks for your response. I should have written that I can't use the GAC either
since I don't have control over the referenced assembly. I just know that it
will be getting updated regularly. 

Thanks

Sumeet
Post Reply
Re: using a custom bin directory for references in a web app
Wed, 19 Mar 2008 02:15:10 +000
Hi Sumeet,

As far as I know, if you add the reference to a dll file directly, that dll file
will be copied to local and the current project will not know whether the
original dll is changed or not. 

In my opinion, there are three workarounds for this situation. If you can access
the control library project, add reference to that project instead of the
generated assembly. 

Alternativelly you can add the command (for example: copy
d:\projectName\bin\project.dll f:\test\bin\ /Y) in that control library project
for copying dll to the target directory automatically after building (in
Post-build event).

Build Events Page, Project Designer (C#)
http://msdn2.microsoft.com/en-us/library/e2s2128d(VS.80).aspx

However, if you cannot access the control library project, the only way to
implement the auto copying feature is to write a Windows service to monitor the
source dll file. If the dll file changes, copy it to the target directory. The
“FileSystemWatcher” class can monitor the file changing.

FileSystemWatcher Class
http://msdn2.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
Post Reply
about | contact