473,785 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileNotFound exception when remoting

Hi All,

I got exception when call Activator.GetOb ject( ... )

When I start my application I register Channel to communicate between
two computers and register type ReceiverLocator for remoting in
Bind()
Then when I need to get reference to this object on remote computer I
call Lookup and get proxy from remote computer.
Lookup() works fine when I start MyApplication.e xe from current
folder where MyApplication.e xe exists.
But when I start MyApplication from another folder using path to it
(so there is no MyApplication.e xe in current folder)
Activator.GetOb ject() gives me an FileNotFound exception
"File or assembly name MyApplication, or one of its dependencies, was
not found". Copying MyApplication.e xe in the folder where I start
MyApplication.e xe from does not help.

private bool StartDistribute dObjectRegistry (AInt port)
{
ChannelServices .RegisterChanne l( new TcpChannel(nPor t) );
}

public void Bind()
{
Type t = Type.GetType("C ommunicator.Rec eiverLocator,My Application");
RemotingConfigu ration.Register WellKnownServic eType(t,
"ReceiverLocato r",WellKnownObj ectMode.Singlet on);
}

public static Object Lookup(String name)
{
Object obj = Activator.GetOb ject(typeof(Rec eiverLocator)," tcp:\\RemoteCom puter\ReceiverL ocator");
return obj;
}
Any hints on this issue would be greatly appreciated. Need to fix it
quickly.

Thank you in advance
Roman
Nov 15 '05 #1
2 2126
Roman Muntyanu wrote:
Hi All,

I got exception when call Activator.GetOb ject( ... )

When I start my application I register Channel to communicate between
two computers and register type ReceiverLocator for remoting in
Bind()
Then when I need to get reference to this object on remote computer I
call Lookup and get proxy from remote computer.
Lookup() works fine when I start MyApplication.e xe from current
folder where MyApplication.e xe exists.
But when I start MyApplication from another folder using path to it
(so there is no MyApplication.e xe in current folder)
Activator.GetOb ject() gives me an FileNotFound exception
"File or assembly name MyApplication, or one of its dependencies, was
not found". Copying MyApplication.e xe in the folder where I start
MyApplication.e xe from does not help.

private bool StartDistribute dObjectRegistry (AInt port)
{
ChannelServices .RegisterChanne l( new TcpChannel(nPor t) );
}

public void Bind()
{
Type t = Type.GetType("C ommunicator.Rec eiverLocator,My Application");
RemotingConfigu ration.Register WellKnownServic eType(t,
"ReceiverLocato r",WellKnownObj ectMode.Singlet on);
}

public static Object Lookup(String name)
{
Object obj = Activator.GetOb ject(typeof(Rec eiverLocator)," tcp:\\RemoteCom puter\ReceiverL ocator");
return obj;
}
Any hints on this issue would be greatly appreciated. Need to fix it
quickly.

Thank you in advance
Roman


My thoughts are as follows. What is typeof(Receiver Locator)? More
precise, what assembly contains the type ReceiverLocator ? I think you
have some assembly containing the type and just it is not found by CLR.
MSDN says: "Applicatio n base, which is the root location where the
application is being executed" Maybe the "base" is assumed as the
current folder, which is not the one where your MyApplication.e xe is
located.
Maybe you should change the current folder to your application's one.
Check variants of using CMD or link to start it.
If you know where your application will be deployed, you may use
privatePath key in web.config

Dmitry.

Nov 15 '05 #2
Thanks Dmitry for quick response

Actually ReceiverLocator class is in MyApplication.e xe assembly.
And I need to start MyApplication from different places:first where it
is located and second using specific path

MyApplication is desktop application. And you pointed me to right point.
I need to use AppendPrivatePa th for the domain. Will try, should work

Thank you very much
Roman

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
394
by: Tom | last post by:
I load an assembly via Assembly assembly=Assembly.LoadFile(assemblyName); .... foreach(Type t in types) { attribs=t.GetCustomAttributes(typeof(MayaPanelAttribute),true); }
12
8502
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too. I, too, am getting nasty FileNotFound exceptions. I've read, and digested the article, and I think I've found a bug -- it's difficult to track, though it does happen often.
1
1312
by: Salvador Ponticelli | last post by:
In an ASP.NET Application I have an instance of a remoting object. After the instance was created, I saved it in a Session variable. When I try to use this instance with the Remoting Service down, it throw an exception wich it is catched. After this exception is catched, another exception is throwed outside my try-catch blocks. I can´t catch this new exception. This happen only in first and second execution after application compile. After...
0
1076
by: Simon Stewart \(C# MVP\) | last post by:
Hi Our scenario is: Various business objects on a server using interfaced-based remoting being called by a thick Windows client - all written in .NET 1.1. Objects are running under a domain admin/domain user account and hosted as a Windows Service on Windows 2003. In some situations, instead of receiving a "normal" exception or one of our custom exceptions we receive the following:
0
1423
by: Mike Grishaber | last post by:
I am using .NET Remoting to connect my incoming HTTP Requests to my business logic. I am using a custom IHttpAsyncHandler to receive the incoming HTTPRequests and then I forward the IHTTPAsyncHandler to my application which runs a .NET Remoting server. The application stores a reference to the IHTTPAsyncHandler proxy until the request has been processed. When it is done, it retrieves the IHTTPAsyncHandler proxy and returns the results back...
0
1548
by: stand__sure | last post by:
in re-reading something on .NET remoting I realized that I had done nothing with lease sponsorship and renewal. so, I dug around in msdn2 and found this topic http://msdn2.microsoft.com/library/6tkeax11(en-us,vs.80).aspx. However, in my testing I have come across a Security Exception that I cannot overcome. The documentation seems to indicate an Infrastructure permission being needed, but I have declaratively demanded this permission......
4
2265
by: Sharon | last post by:
Hi, I'm using the remoting, and I have a remoting object that has a public event that other processes should register to it. But when the client process is registering to the remote event, it throw the following exception: System.Runtime.Serialization.SerializationException {“Cannot find the assembly Tester, Version=1.0.2164.27180, Culture=neutral, PublicKeyToken=null.”}
1
1424
by: ropo | last post by:
I have a class library used by a windows service executable, both binaries and dependancies are in one bin directory located on c:. 1) I can run a test app on my class library without failure 2) My service runs, but if I reference anything in the class library it fails with a FileNotFound exception e.g. MyClassLib.MyClass A = null; will cause the exception 3) my service runs under the system account 4) using Window XP SP2 5) My class...
0
1578
by: senpark15 | last post by:
Hi EveryBody, I am developing .net remoting application.I have Created server and client application. Server has installed on Two Pc's and cliient have to connect two Pc's and do some functions. Its working Fine on local machine . But when i tried to connect two PC's, its through an remoting exception This is my server code: Dictionary<string, object> props = new Dictionary<string, object>(); props = "Full";
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.