There is a public, parameterless ctor, but that wasn't the one being called.

I did finally figure out the problem.

Both the type being remoted, and the type calling it, are in the same
assembly. The type calling it was using a ctor marked "internal" (rather
than public), which obviously compiles just fine, but fails when it's being
called over Remoting (with the above mentioned unhelpful error).

Changing the calling type to call a public ctor fixed the error.

On 7/3/06, Patrick Steele <[EMAIL PROTECTED]> wrote:

This is just a wild guess, but do you have a public, parameterless ctor?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele



-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Eric Means
Sent: Friday, June 30, 2006 11:26 AM
To: [email protected]
Subject: [ADVANCED-DOTNET] Client Activated Object - Can't find ..ctor?


I have a client-activated object that is failing with a
RemotingException. The exception's message is "The method '.ctor' was
not found on the interface/type 'My.Type, MyTypeLibrary,
Version=1.0.2371.15203, Culture=neutral, PublicKeyToken=null'.".

The client code is hosted in Internet Explorer; the server code is
hosted in IIS, using the binary channel over HTTP.

The client is using the following config values:
  <system.runtime.remoting>
    <application>
      <client url="http://localhost/MyVirtualDir/";>
        <activated type="My.Type, MyTypeLibrary"/>
      </client>
      <channels>
        <channel ref="http">
          <clientProviders>
            <formatter ref="binary" />
          </clientProviders>
        </channel>
      </channels>
    </application>
  </system.runtime.remoting>

The server web.config includes:
        <system.runtime.remoting>
                <application>
                        <service>
                                <activated type="My.Type,
MyTypeLibrary"/>
                        </service>
                        <channels>
                                <channel ref="http">
                                        <serverProviders>
                                                <formatter
ref="binary"/>
                                        </serverProviders>
                                </channel>
                        </channels>
                </application>
        </system.runtime.remoting>

The MyTypeLibrary does exist in the web application's bin directory.

One other oddity is that the IE-hosted control is being served from a
different virtual directory. The file structure looks like this:
MyVirtualDir (virtual dir)  -> \bin  -> \bin\MyTypeLibrary.dll  ->
\DownloadBin (virtual dir, from elsewhere in the filesystem)  ->
\DownloadBin\MyControl.dll

The full stack trace (at the point where it leaves my code) is:

Server stack trace:
   at
System.Runtime.Remoting.Activation.LocalActivator.GetMethodBase(IConstru
ctionCallMessage
msg)
   at
System.Runtime.Remoting.Activation.LocalActivator.Activate(IConstruction
CallMessage
ctorMsg)
   at
System.Runtime.Remoting.Activation.ActivationListener.Activate(IConstruc
tionCallMessage
ctorMsg)
   at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessag
e(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
   at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage
(RuntimeMethodHandle
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
   at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IM
essage
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
   at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
   at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
   at
System.Runtime.Remoting.Activation.IActivator.Activate(IConstructionCall
Message
msg)
   at
System.Runtime.Remoting.Activation.LocalActivator.DoRemoteActivation(ICo
nstructionCallMessage
ctorMsg)
   at
System.Runtime.Remoting.Activation.LocalActivator.Activate(IConstruction
CallMessage
ctorMsg)
   at
System.Runtime.Remoting.Activation.AppDomainLevelActivator.Activate(ICon
structionCallMessage
ctorMsg)
   at
System.Runtime.Remoting.Messaging.ClientContextTerminatorSink.SyncProces
sMessage(IMessage
reqMsg)
   at
System.Runtime.Remoting.Activation.ActivationServices.Activate(RemotingP
roxy
remProxy, IConstructionCallMessage ctorMsg)
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(IMessage
reqMsg)
   at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
   at My.Type..ctor(Boolean param)

There is no InnerException.
How should I go about debugging this? The site has FullTrust in the CAS
policy (I've already verified that). Why is it not finding the
constructor?

--
Eric Means
[EMAIL PROTECTED]
http://www.randomtree.org/eric/

===================================
This list is hosted by DevelopMentorR  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com




--
Eric Means
[EMAIL PROTECTED]
http://www.randomtree.org/eric/

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to