HighTechTalks DotNet Forums  

Unhandled Exception: System.IO.FileNotFoundException:....

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Unhandled Exception: System.IO.FileNotFoundException:.... in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
scsharma
 
Posts: n/a

Default Unhandled Exception: System.IO.FileNotFoundException:.... - 11-07-2006 , 11:28 AM






Hi
I am new to remoting and was trying to run a sample thats provided with
visual studio 2005 documentation. I am following every step mentioned in the
documentation.
URL for the sample i am trying is

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxremoting/html/606c5688-ed0b-432e-9c57-27cf68f8ce39.htm


When i run the client.exe program i am getting following exception:


Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'ServiceClass, Version=0.0.0.0, Cult
ure=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.
File name: 'ServiceClass, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'
at Client.Main(String[] Args)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].


I cannot get this sample to work with .net1.1 either. Any help greatly
appreciated.
--
Thanks
SCS

Reply With Quote
  #2  
Old   
Phill W.
 
Posts: n/a

Default Re: Unhandled Exception: System.IO.FileNotFoundException:.... - 11-07-2006 , 12:13 PM






scsharma wrote:

Quote:
When i run the client.exe program i am getting following exception:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'ServiceClass, Version=0.0.0.0, Cult
ure=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.
File name: 'ServiceClass, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'
at Client.Main(String[] Args)
So the client program cannot load your Service assembly which, I assume
defines the Remoted Component. Since the assembly isn't in the Global
Assembly Cache (no PublicKeyToken), unless you have entries in
App.Config to tell it otherwise, the application expects to find this
assembly in the same directory as the application.

HTH,
Phill W.


Reply With Quote
  #3  
Old   
scsharma
 
Posts: n/a

Default Re: Unhandled Exception: System.IO.FileNotFoundException:.... - 11-07-2006 , 01:01 PM



But thats was not mentioned in the document. I assumed that once i tell my
client program that my remote components are hosted in IIS everything should
be good to go. If thats not true, can you please advice how i can tell the
..config file to not look for assembly in GAC
Thanks in advance
--
Thanks
SCS


"Phill W." wrote:

Quote:
scsharma wrote:

When i run the client.exe program i am getting following exception:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'ServiceClass, Version=0.0.0.0, Cult
ure=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.
File name: 'ServiceClass, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'
at Client.Main(String[] Args)

So the client program cannot load your Service assembly which, I assume
defines the Remoted Component. Since the assembly isn't in the Global
Assembly Cache (no PublicKeyToken), unless you have entries in
App.Config to tell it otherwise, the application expects to find this
assembly in the same directory as the application.

HTH,
Phill W.


Reply With Quote
  #4  
Old   
Phill W.
 
Posts: n/a

Default Re: Unhandled Exception: System.IO.FileNotFoundException:.... - 11-08-2006 , 04:57 AM



scsharma wrote:
Quote:
But thats was not mentioned in the document.
Now there's a surprise ... ;-)

Quote:
I assumed that once i tell my client program that my remote components
are hosted in IIS everything should be good to go.
I've not used IIS as a host, I prefer using my own Service but the
client-side stuff shouldn't be /very/ different, if at all.

Quote:
can you please advice how i can tell the .config file to not look
for assembly in GAC
You can't. The Framework will search the GAC for an assembly and, if it
finds it, will use it from there - IIRC, it's more efficient loading
things this way around.
However, since your assembly /isn't/ in the GAC, you can identify where
it lives by using dependentAssembly and CodeBase entries in App.Config,
something like

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="X.Y.Z.Class"
publicKeyToken="1234567890123456" culture="neutral" />
<codeBase version="1.0.0.0" href="..\Dir1\X.Y.Z.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

HTH,
Phill W.


Reply With Quote
  #5  
Old   
scsharma
 
Posts: n/a

Default Re: Unhandled Exception: System.IO.FileNotFoundException:.... - 11-08-2006 , 09:16 AM



Thanks a lot Phil. It helps.

--
Thanks
SCS


"Phill W." wrote:

Quote:
scsharma wrote:
But thats was not mentioned in the document.

Now there's a surprise ... ;-)

I assumed that once i tell my client program that my remote components
are hosted in IIS everything should be good to go.

I've not used IIS as a host, I prefer using my own Service but the
client-side stuff shouldn't be /very/ different, if at all.

can you please advice how i can tell the .config file to not look
for assembly in GAC

You can't. The Framework will search the GAC for an assembly and, if it
finds it, will use it from there - IIRC, it's more efficient loading
things this way around.
However, since your assembly /isn't/ in the GAC, you can identify where
it lives by using dependentAssembly and CodeBase entries in App.Config,
something like

?xml version="1.0" encoding="utf-8" ?
configuration
runtime
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
dependentAssembly
assemblyIdentity name="X.Y.Z.Class"
publicKeyToken="1234567890123456" culture="neutral" /
codeBase version="1.0.0.0" href="..\Dir1\X.Y.Z.dll" /
/dependentAssembly
/assemblyBinding
/runtime
/configuration

HTH,
Phill W.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.