Another “Because of security restrictions” error

Another “Because of security restrictions” error

Old forum URL: forums.lhotka.net/forums/t/2459.aspx


RichardETVS posted on Friday, March 02, 2007

Hi

I used an example application who works fine (it is your code, phucphlq) on local, with no remoting, configuration.

I tried to make it as client server one, with the server in a console app.


        static void Main(string[] args)
        {

            Console.WriteLine("ServerStartup.Main(): Server started");

            HttpChannel chnl = new HttpChannel(1234);
            ChannelServices.RegisterChannel(chnl);
            RemotingConfiguration.RegisterWellKnownServiceType(
                    typeof(Csla.Server.Hosts.RemotingPortal),
                    "RemotingPortal.rem",
                    WellKnownObjectMode.SingleCall);

            // the server will keep running until keypress.
            Console.ReadLine();
        }

The client side has this conf. file :


<configuration>
    <configSections>
    </configSections>
  <appSettings>
   
    <add key="CslaDataPortalProxy"
      value="Csla.DataPortalClient.RemotingProxy, Csla"/>
    <add key="CslaDataPortalUrl"
      value="http://localhost:1234/RemotingPortal.rem"/>
    </appSettings> 
    <connectionStrings>
      <!--<add name="DatabaseFile" connectionString="Db4oCSLA.yap" />-->
    </connectionStrings>
</configuration>

When I start the client, I get the error “Because of security restrictions Csla.Server.DataPortalContext is unavaible” in the “public class EditableRootEmployee:Csla.BusinessBase<EditableRootEmployee>” class, at the line in bold:


        public static EditableRootEmployee New()
        {
            return Csla.DataPortal.Create<EditableRootEmployee>();
        }
  
        protected override void DataPortal_Create()
        {
            MarkOld();
        }
  
  

I am not how to translate the inner exception in English, something like “failure of the request”.

I read various subjects about this error in this forum but as far I did not find solution. All classes are serializable, I do not use IIS, I signed all the assemblies…

Any help would be welcome

Thanks

Richard

RichardETVS replied on Friday, March 02, 2007

Well, I tried another approach, so... I get a different error. Let's say I am learning ;)

http://forums.lhotka.net/forums/12755/ShowThread.aspx#12755

It works, problem solved :) .

RockfordLhotka replied on Friday, March 02, 2007

By the way, CSLA .NET is localizable - all the strings (unless I missed some - which would be a bug) should come from resource files. If there isn't a resource file for your language, and you are willing to create one, I am always glad to add it to the core framework.

All the languages beyond English that come with the framework were created and kindly donated by people around the world.

Copyright (c) Marimer LLC