Unable to reference files..

  • Thread starter Thread starter VJ
  • Start date Start date
V

VJ

My application is installing files in C:\Program Files\Common Files\Company
Name\Shared Files\. The application installed cannot find files in this
directory. I thought putting this in Path (system) variable should help!. I
even restarted the computer... what should I do?

VJ
 
VJ,

Well, the simple answer is to remove those files from the install. If
your application is completely managed, then why are you not just placing
all of the files in the application directory?
 
The .Net CLR is programmed to look, for an assembly, up the BIN, the GAC
and the URL specified in the app's config file to download and other
related files of the application.

What type of files are you talking about ?

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
I should have said this. We have 5 applications and would like to share like
6 Dll's among these applications. All five applications are installed
separately. I want to be able to put these 6 DLLs in common location and
make it available for all 5 applications. I don't think shipping them with
each package is also a great idea. Plus the requirement is also that one of
the container application would refer to the other 4 applications and
certain Dll's, & will not carry these common Dlls in its package

VJ
 
VJ,

If that is the case, then when you want to update a component, you would
have to make sure that the five applications have been shut down (for the
most part, unless you are working with multiple application domains, then
you can just shut down those application domains which have your component
loaded).
 
I still have not resloved this?... without using the GAC how do I shared
files (dlls) across two of my .NET applications

Thanks
VJ
 
non-strong named assemblies cannot be loaded from outside of the appbase (the directory the app is run from) without using explicit loading using Assembly.LoadFrom (which takes an explicit path to the assembly) and thenyou'll have to access the types via latebound instantiation

Or you could hack it by installing both apps into the same directory

Is there some reason you don't want to strong name the assembly?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

for not a strong named what do we do?

VJ
 
No particular reason...Just was exploring the other options.. I will strong
name it and then try the codebase attribute.. looks like a more secure and
smooth way to do it..

Thanks
VJ
 
Thanks Richard the signing key worked pretty well..... Had to figure out the
deal with some COM dll's we were using that complained as not signed... The
AXimp.exe util took care of that problem... I just have one question.. are
there are any disadvantages to using one key for all our company's
assemblys?

VJ
 
You specify the url through a codebase element in the app/web.config
file. You can test this by adding a reference to a DLL but after
successful completion delete the DLL. You will get exceptions related to
"Trying to download "file" etc. This technique is called probing that
is done through the <codeBase> element.

For example, the following sets a codebase url for an assembly

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="neutral" />
<codeBase version="2.0.0.0"
href="http://www.litwareinc.com/myAssembly.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

The above can be found in msdn at

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenre
f/html/gngrfCodeBase.asp

You can set this element when using the .Net Framework Configuration 1.1
tool in the Administrative Tools when you are configuring an application
or you can manually code it into the web.config file. Remember to
copy/paste the above into the web.config file separately.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
Back
Top