Home Forums Support Silverlight error.

Tagged: 

  • This topic has 6 replies, 3 voices, and was last updated 11 years ago by Anonymous.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1049
    Anonymous
    Inactive

    dear

    i can not use Networkcomms Dll in a Silverlight Application, it return an error at:
    ChatMessage messageToSend = new ChatMessage(NetworkComms.NetworkIdentifier, localName, toSend, messageSendIndex++);
    the error message is:

    System.TypeInitializationException was unhandled by user code
      Message=The type initializer for 'NetworkCommsDotNet.NetworkComms' threw an exception.
      TypeName=NetworkCommsDotNet.NetworkComms
      StackTrace:
           at NetworkCommsDotNet.NetworkComms.get_NetworkIdentifier()
           at ExamplesSLChat.MainPage.SendMessage(String toSend)
           at ExamplesSLChat.MainPage.Button_Click(Object sender, RoutedEventArgs e)
           at System.Windows.Controls.Primitives.ButtonBase.OnClick()
           at System.Windows.Controls.Button.OnClick()
           at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
           at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
           at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
      InnerException: System.MethodAccessException
           Message=Attempt by method 'DPSBase.DPSManager.AddDataProcessor<System.__Canon>()' to access method 'SevenZipLZMACompressor.LZMACompressor..ctor()' failed.
           StackTrace:
                at System.RuntimeMethodHandle.PerformSecurityCheck(Object obj, RuntimeMethodHandleInternal method, RuntimeType parent, UInt32 invocationFlags)
                at System.RuntimeMethodHandle.PerformSecurityCheck(Object obj, IRuntimeMethodInfo method, RuntimeType parent, UInt32 invocationFlags)
                at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                at DPSBase.DPSManager.AddDataProcessor[T]()
                at NetworkCommsDotNet.NetworkComms..cctor()
           InnerException: 
    

    please help me. thanks

    #1052
    Anonymous
    Inactive

    We are looking into this.

    Regards,
    Marc

    #1053
    Anonymous
    Inactive

    Could you please give us a little more information as to the type of Silverlight application you are developing and also what your development environment is?

    #1063
    Anonymous
    Inactive

    I am having the same exact error. I am testing with a brand new silverlight 5 application where the only line of code is the send object command. I am using VS2012.

    #1064
    Anonymous
    Inactive

    Ah, I have discovered the issue.

    The LZMACompressor constructor is private. The silverlight reflection runtime , unlike the full .net runtime, does not allow you to reflect over or invoke private methods. This was done to protect the internal silverlight runtime as it is run in the web and should never be compromised. Setting the constructor to public should fix the issue.

    #1066
    Anonymous
    Inactive

    Heya Dbaile10,

    Are you able to test this fix using the source download?

    Regards,
    Marc

    #1067
    Anonymous
    Inactive

    Unfortunately no. I can edit the source, but I need windows 8 to compile. I could fire up a VM but my job has me working some long hours at the moment and I wouldn’t be able to get to it until sometime next week.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.