Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remoting in service and loading object from GAC

5 views
Skip to first unread message

Raghu Rudra

unread,
Oct 21, 2002, 12:21:14 AM10/21/02
to
I have an interesting problem.

I authored a dll with strong name and installed into GAC. I also authored a
service host (as window service) that has compile dependency to this library
and registers the object in the dll as remotable (singlecall).

However when the client application tries to call a method on this object,
it throws an exception saying the library dll is not found in the same
directory as service host executable directory.

However when I place the dll in the same directory as service host
executable, every thing works fine.

Obviously the .NET remoting framework is trying to create the object from
the same directory as the host. Since the dll is in a separate directory
(which is required for other reasons), how can I instruct the framework to
instantiate the object from GAC?

Thanks.
Raghu/..


jswa...@freemind.net

unread,
Nov 6, 2002, 12:01:21 PM11/6/02
to
I am seeing this exact same behavior. I'll let you know if I can
figure out a workaround that doesn't require placing the dll in both
the GAC and local directories.

Ingo Rammer

unread,
Nov 6, 2002, 1:33:15 PM11/6/02
to
> I am seeing this exact same behavior. I'll let you know if I can
> figure out a workaround that doesn't require placing the dll in both
> the GAC and local directories.

Did you register it by using a configuration file or by code? If
config-file, did you include the complete strong name in the cfg?

-Ingo

Author of "Advanced .NET Remoting" and
"Advanced .NET Remoting in VB.NET"
http://www.dotnetremoting.cc


james swanson

unread,
Nov 6, 2002, 3:31:46 PM11/6/02
to
The online docs say that you can specify the strong name for the wellknown
element of the client:

"Specifies the full type name of the object and the assembly name of the
type implementation on the client. This includes version, culture, and
public key information if the containing assembly is in the global assembly
cache."

And you actually can specify the strong name in the wellknown element of a
service. But if you do this for the client you will get a RemotingException
when you call RemotingConfiguration.Configure();

"System.Runtime.Remoting.RemotingException: Version information is present
in the assembly name
'MetadataCommon,Version=1.0.0.0,Culture=neutral,PublicKeyToken=11acdaed89027
8df' which is not allowed for client wellknown entries. "


MORE DETAILS
---------------------

Exception Type: System.Runtime.Remoting.RemotingException
Message: .Config file D:\Application\AWD\metadataServiceClient.config can
not be read successfully due to exception
System.Runtime.Remoting.RemotingException: Version information is present in
the assembly name
'MetadataCommon,Version=1.0.0.0,Culture=neutral,PublicKeyToken=11acdaed89027
8df' which is not allowed for client wellknown entries.
at
System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ReportError(S
tring errorStr, RemotingXmlConfigFileData configData)
at
System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ProcessClient
WellKnownNode(ConfigNode node, RemotingXmlConfigFileData configData,
RemoteAppEntry remoteApp)
at
System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ProcessClient
Node(ConfigNode node, RemotingXmlConfigFileData configData)
at
System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ProcessApplic
ationNode(ConfigNode node, RemotingXmlConfigFileData configData)
at
System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ParseConfigFi
le(String filename)
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(S
tring filename).
TargetSite: System.Runtime.Remoting.Activation.RemotingXmlConfigFileData
LoadConfigurationFromXmlFile(System.String)
HelpLink: NULL
Source: mscorlib
StackTrace Information
*********************************************
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(S
tring filename)
at System.Runtime.Remoting.RemotingConfiguration.Configure(String filename)
at EnumServiceTester.Form1.ReadRemoteConfig(String configFileSetting)
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

"Ingo Rammer" <ram...@sycom.at> wrote in message
news:eQeZLLchCHA.1232@tkmsftngp09...

james swanson

unread,
Nov 7, 2002, 2:22:40 PM11/7/02
to
Here is one possible workaround.

Because the assembly reference in the config is not strongly named (and
because it appears there is a bug that throws an exception when the strong
name is placed in the client section) the loader does not check the GAC
first when probing for the assembly.

If we add a qualifyAssembly element to the config we can tell the loader
that all references to the weakly named assembly actually matchup to a
specific strongly named assembly.


<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<qualifyAssembly partialName="MetadataCommon" fullName=
"MetadataCommon,version=1.0.0.0,publicKeyToken=11acdaed890278df,culture=neut
ral"/>
</assemblyBinding>
</runtime>


"james swanson" <jswans...@freemind.net> wrote in message
news:eb3mzNdhCHA.1864@tkmsftngp11...

Ingo Rammer

unread,
Nov 7, 2002, 2:59:42 PM11/7/02
to
That's a good one. Thanks for sharing.

-Ingo

Author of "Advanced .NET Remoting" and
"Advanced .NET Remoting in VB.NET"
http://www.dotnetremoting.cc

"james swanson" <jswans...@freemind.net> wrote in message
news:uEpK2LphCHA.1356@tkmsftngp11...

0 new messages