I'm successfully hosting a remoting server in IIS and sending LLBLGenPro entities to my client over HttpChannel in binary format. Now I want to instantiate and fill an entity on the client and then send back to the server where it will be saved in the database. When I do that I get this message:
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
Additional information: Because of security restrictions, the type SD.LLBLGen.Pro.ORMSupportClasses.EntityFields2 cannot be accessed.
The output window has some additional information:
Unhandled Exception: System.Runtime.Serialization.SerializationException: Because of security restrictions, the type SD.LLBLGen.Pro.ORMSupportClasses.EntityFields2 cannot be accessed. ---> System.Security.SecurityException: Request failed.
at System.Security.SecurityRuntime.FrameDescSetHelper(FrameSecurityDescriptor secDesc, PermissionSet demandSet, PermissionSet& alteredDemandSet)
at System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
--- End of inner exception stack trace ---
Server stack trace:
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
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 Chevron.Completions.Remoting.Interfaces.ICompletionsRemote.SaveCompletionStart(CompletionStartEntity completionStart)
at Chevron.Completions.Local.BLL.CompletionManager.SaveCompletionStart(CompletionStartEntity completionStart) in C:\Clients\Chevron\Completions\Visual Studio\Chevron.Completions.Local.BLL\CompletionManager.cs:line 72
at Chevron.Completions.Local.UI.MainWindow.New_Click(Object sender, EventArgs e) in c:\clients\chevron\completions\visual studio\chevron.completions.local.ui\mainwindow.cs:line 175
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainFThe program '[6176] CompletionsLocal.exe' has exited with code 0 (0x0).
orm)
at Chevron.Completions.Local.UI.MainWindow.Main() in c:\clients\chevron\completions\visual studio\chevron.completions.local.ui\mainwindow.cs:line 155The program '[2612] aspnet_wp.exe: /LM/W3SVC/1/Root/Completions-1-127644788940156250' has exited with code 0 (0x0).
I haven't been able to figure out how to debug my remoting code on the server. I thought perhaps I should be attaching to the aspnet_wp.exe process, but I don't see it in the dialog. All these projects are in the same VS Studio solution, and everything is running on my machine.
I don't think the entity is even making it to the server because when I comment all the code in the server function that does something, I still get this error.