I am having the same problem in a remoting scenario not using IIS.
I have an interface IOrganization :
public interface IOrganization
{
bool SaveOrganization( OrganizationEntity org );
}
I have an implementation :
public class OrganizationImpl : MarshalByRefObject, IOrganization
{
public bool SaveOrganization( OrganizationEntity org )
{
DataAccessAdapter adapter = new DataAccessAdapter( );
return adapter.SaveEntity( org );
}
}
The implementation is hosted in a service driven by the following config file
[code]
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Main.ConnectionString" value="..." />
<add key="CatalogNameUsageSetting" value="1" />
<add key="CatalogNameToUse" value="ABSystemVII" />
</appSettings>
<system.runtime.remoting>
<application name="Application Server">
<service>
<wellknown mode="SingleCall"
type="Autobase.Organization.OrganizationImpl, LibOrganization"
objectUri="OrganizationURI" />
</service>
<channels>
<channel ref="http" port="8686" />
<serverProviders>
<formatter ref="soap" typeFilterLevel="Full" />
</serverProviders>
</channels>
</application>
</system.runtime.remoting>
</configuration>
[/code/
On the client side we don't use config files but create the channel programatically:
channel = new HttpChannel( 0 );
ChannelServices.RegisterChannel( channel );
string objectUrl = "http://localhost:8686/OrganizationURI";
remotetype = new WellKnownClientTypeEntry(typeof(IOrganization), objectUrl );
RemotingConfiguration.RegisterWellKnownClientType(remotetype);
IOrganization organizationImpl = (IOrganization)Activator.GetObject( typeof (IOrganization), remotetype.ObjectUrl);
And then we call the save method
organizationImpl.SaveOrganization( someOrganitationEntity );
This results in the afformentioned security error.
I have read the MSDN note and have tried numerous variations on the information therein. I am pretty sure I am missing something stupid, but am tired of banging my head against the wall. Can anybody provide me a bit of assistance?
Thanks
Mike