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/..
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
"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...
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
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...