Coder Social home page Coder Social logo

System.TypeLoadException: Could not load type 'Workstation.ServiceModel.Ua.Subscription[]' from assembly 'Workstation.UaClient, Version=1.5.0.30692 about opc-ua-samples HOT 18 CLOSED

convertersystems avatar convertersystems commented on May 27, 2024
System.TypeLoadException: Could not load type 'Workstation.ServiceModel.Ua.Subscription[]' from assembly 'Workstation.UaClient, Version=1.5.0.30692

from opc-ua-samples.

Comments (18)

awcullen avatar awcullen commented on May 27, 2024

Works in the emulator set for Android 7.1 - API 25 (also tested Android 6.0 - API 23).
screenshot_1482369221

I'm connecting to UnifiedAutomation's CPP Demo server on a second pc. I had to set the client's EndpointUrl to remote pc's IPAddress instead of the host name because of WINS issues on the emulator.

The first attempt won't connect. Open the UA Server Administrator on the remote pc and TRUST the 'Workstation.MobileHmi' certificate.
ua server administrator

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

Deploying it in Mobile phone with Andoroid API Level 23 does not work. it throws an exception still.

Have you tried debugging it in a mobile phone?

from opc-ua-samples.

awcullen avatar awcullen commented on May 27, 2024

Would you zip up your OpcUaMobileTest solution and post it in DropBox again?

I will get my phone back when my son comes home from college ;)

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

okay will send you the test application that i'm using

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

https://www.dropbox.com/s/vcw0xld5zgvl89d/App1.zip?dl=0

from opc-ua-samples.

awcullen avatar awcullen commented on May 27, 2024

I tested my sample "MobileHmi" on a Samsung phone running Android 6.0 (Api 23). The app connects to a Unified Automation's C++ Demo Server on the local intranet. It is using security profile Basic256 sign and encrypt.
Two items to note:
I connected the USB cable from my PC to the phone and activated USB Debugging. This involved tapping the Build Number seven times to reveal the "Developer Options" tab. See https://developer.xamarin.com/guides/android/getting_started/installation/set_up_device_for_development/. Then the Samsung became available as a debugging Target.

As always, you have to remember on the first run to tell the OPC UA Server to trust the client certificate. For the UA CPP Demo Server, this involves opening the UA Admin Dialog, finding the new certificate, and trusting it.

from opc-ua-samples.

awcullen avatar awcullen commented on May 27, 2024

I tested your sample "App1" on the Android Emulator. I had to make these changes:
First, I used the "OPC UA Technology Samples Welcome Dashboard" to start the "DA Server".

Second, I changed the url in "MainActivity.cs" to 10.0.2.2, because the server was running on the same pc as the emulator.
private string discoveryUrl = @"opc.tcp://10.0.2.2:62547/Quickstarts/DataAccessServer";

Third, I ran the app on the simulator. Initially the app did not connect to the server because the app certificate was not trusted. I found the server put the app certificate in the directory:
C:\ProgramData\OPC Foundation\CertificateStores\RejectedCertificates\certs

Fourth, I moved the .der file from the above directory to the following:
C:\ProgramData\OPC Foundation\CertificateStores\UA Applications\certs

Finally, the server accepted the app certificate and allowed the connection:
2016-12-27 1

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

On your test in the Samsung Mobile App, what IP Address you used for the discoverUrl?

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

when debugging in Samsung S6 API 23, i can't see the certificate in the refected certficate store. I'm using the DataAccessServer from OPC.

It fails in the creation of UaTcpSessionClient

// Create the session client for the app. this.session = new UaTcpSessionClient( new ApplicationDescription() { ApplicationName = "Workstation.MobileHmi", ApplicationUri = $"urn:{System.Net.Dns.GetHostName()}:Workstation.MobileHmi", ApplicationType = ApplicationType.Client }, new DirectoryStore( Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "pki"), loggerFactory: loggerFactory), this.ProvideUserIdentity, this.discoveryUrl, this.loggerFactory);

from opc-ua-samples.

awcullen avatar awcullen commented on May 27, 2024

For my test on the Samsung phone, the phone was connected by wifi to my home network. I started the UA C++ Demo Server on my desktop. The phone connected to the desktop using url: opc.tcp://192.168.1.108:48010.

For the OPC Foundation's DA Server, I would try url opc.tcp://[ip address]:62547

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

I tested two servers. One is auto-accept and one is from the foundation test servers.

I was not able to see the rejected certificate from the foundation test servers which i think that my test client appliction didn't connect successfully to the foundation test servers.

from opc-ua-samples.

awcullen avatar awcullen commented on May 27, 2024

Could you copy the debug text from the output window and put it in a file on DropBox?
Thanks.

Also, could you install Ping -or- PingTools from Google Play on the phone? Then you could check if the IP Address is accessible.

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

The IP Address is accessible since the test application i created using Prosys SDK in Java works (trial version).
I also tried some Ping tools and it is accessible.

Here is the link of the output : https://www.dropbox.com/s/lwvu33ohfxzyu3u/output.txt?dl=0

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

any updates on the issue?

from opc-ua-samples.

awcullen avatar awcullen commented on May 27, 2024

2017-01-10
device-2017-01-10-105547

I have your App1 working on my Samsung S6 running Android 6.0.1.
Here's how I did it.

On the phone I activated Developer Mode and made sure USB Debugging was enabled. I connected the phone to my notebook via the USB cable. Visual Studio discovered the device and added it as a target for debugging. I ensured that the phone also had a WIFI connection to my home network.

I made these changes to your App1.Droid project :
Added a Nuget package: Microsoft.Extensions.Logging.Debug v1.0.1
In MainActivity.cs, I changed the discoveryUrl to use the IP Address of my notebook. I added a line to cause the logger to write to the debugger.

   private string discoveryUrl = @"opc.tcp://192.168.1.109:62547/Quickstarts/DataAccessServer";
     // Setup a logger.
    this.loggerFactory = new LoggerFactory();
    this.loggerFactory.AddDebug(LogLevel.Trace); // added this line
    this.logger = this.loggerFactory.CreateLogger<MainActivity>();

On the notebook:
I started the OPC Foundation Data Access Server. I then started debugging App1 in Visual Studio. The selected target was the Samsung SM-G920A.
Initially the debugger repeated:
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Trace: Channel opening.
[0:] Workstation.ServiceModel.Ua.DirectoryStore: Trace: Found certificate with subject alt name 'urn:localhost:Workstation.MobileHmi'.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Information: Opening secure channel with endpoint 'opc.tcp://192.168.1.109:62547'.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Information: SecurityPolicy: 'http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15'.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Information: SecurityMode: 'SignAndEncrypt'.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Information: UserIdentityToken: 'Workstation.ServiceModel.Ua.AnonymousIdentity'.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Trace: Sending OpenSecureChannelRequest Handle: 2
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Trace: Canceled OpenSecureChannelRequest Handle: 2
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Trace: Channel faulted.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Trace: Channel closing.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Trace: Waiting for socket to close.
[0:] Workstation.ServiceModel.Ua.UaTcpSessionClient: Error: Error opening channel with endpoint 'opc.tcp://192.168.1.109:62547'. Timeout occurred while processing the request.
[0:] Workstation.ServiceModel.Ua.UaTcpSessionClient: Error: State machine retrying. Timeout occurred while processing the request.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Error: Timeout while waiting for socket to close.
[0:] Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel: Trace: Channel closed.

I opened the folder:
C:\ProgramData\OPC Foundation\CertificateStores\RejectedCertificates\certs
I moved the .der file from the above directory to the following:
C:\ProgramData\OPC Foundation\CertificateStores\UA Applications\certs

The next connection retry was successful.

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

thanks will try this as soon as possible.

Can you send the changed project to a dropbox? thanks

from opc-ua-samples.

CarlCrol avatar CarlCrol commented on May 27, 2024

I tried pinging the machine where the server is running through my phone. I was able to do it. But still the exception still occurs with your suggestion.

01-17 09:15:43.961 D/Mono ( 7649): Assembly Loader probing location: '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.IO.dll'.
01-17 09:15:43.961 D/Mono ( 7649): AOT module '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.IO.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.IO.dll.so" not found
01-17 09:15:43.961 D/Mono ( 7649): AOT module '/Users/builder/data/lanes/3415/7db2aac3/source/monodroid/builds/install/mono-armv7/lib/mono/aot-cache/arm/System.IO.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.IO.dll.so" not found
01-17 09:15:43.961 D/Mono ( 7649): Assembly Ref addref BouncyCastle.Crypto[0xeb183680] -> System.IO[0xeb184100]: 3
01-17 09:15:43.981 D/Mono ( 7649): Assembly Loader probing location: '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Globalization.dll'.
01-17 09:15:43.981 D/Mono ( 7649): AOT module '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Globalization.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Globalization.dll.so" not found
01-17 09:15:43.981 D/Mono ( 7649): AOT module '/Users/builder/data/lanes/3415/7db2aac3/source/monodroid/builds/install/mono-armv7/lib/mono/aot-cache/arm/System.Globalization.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Globalization.dll.so" not found
01-17 09:15:43.981 D/Mono ( 7649): Assembly Ref addref BouncyCastle.Crypto[0xeb183680] -> System.Globalization[0xeb184520]: 2
01-17 09:15:44.011 D/Mono ( 7649): Assembly Loader probing location: '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Collections.dll'.
01-17 09:15:44.011 D/Mono ( 7649): AOT module '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Collections.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Collections.dll.so" not found
01-17 09:15:44.011 D/Mono ( 7649): AOT module '/Users/builder/data/lanes/3415/7db2aac3/source/monodroid/builds/install/mono-armv7/lib/mono/aot-cache/arm/System.Collections.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Collections.dll.so" not found
01-17 09:15:44.011 D/Mono ( 7649): Assembly Ref addref BouncyCastle.Crypto[0xeb183680] -> System.Collections[0xeb184880]: 6
01-17 09:15:44.021 D/Mono ( 7649): Assembly Loader probing location: '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Reflection.dll'.
01-17 09:15:44.021 D/Mono ( 7649): AOT module '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Reflection.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Reflection.dll.so" not found
01-17 09:15:44.021 D/Mono ( 7649): AOT module '/Users/builder/data/lanes/3415/7db2aac3/source/monodroid/builds/install/mono-armv7/lib/mono/aot-cache/arm/System.Reflection.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Reflection.dll.so" not found
01-17 09:15:44.021 D/Mono ( 7649): Assembly Ref addref BouncyCastle.Crypto[0xeb183680] -> System.Reflection[0xeb184940]: 5
01-17 09:15:44.041 D/Mono ( 7649): Assembly Loader probing location: '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Threading.dll'.
01-17 09:15:44.041 D/Mono ( 7649): AOT module '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Threading.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Threading.dll.so" not found
01-17 09:15:44.041 D/Mono ( 7649): AOT module '/Users/builder/data/lanes/3415/7db2aac3/source/monodroid/builds/install/mono-armv7/lib/mono/aot-cache/arm/System.Threading.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Threading.dll.so" not found
01-17 09:15:44.041 D/Mono ( 7649): Assembly Ref addref BouncyCastle.Crypto[0xeb183680] -> System.Threading[0xeb184a60]: 6
01-17 09:15:44.101 D/Mono ( 7649): DllImport attempting to load: '__Internal'.
01-17 09:15:44.101 D/Mono ( 7649): DllImport loaded library '(null)'.
01-17 09:15:44.101 D/Mono ( 7649): DllImport searching in: '__Internal' ('(null)').
01-17 09:15:44.101 D/Mono ( 7649): Searching for 'monodroid_get_system_property'.
01-17 09:15:44.101 D/Mono ( 7649): Probing 'monodroid_get_system_property'.
01-17 09:15:44.101 D/Mono ( 7649): Found as 'monodroid_get_system_property'.
01-17 09:15:44.101 D/Mono ( 7649): DllImport searching in: '__Internal' ('(null)').
01-17 09:15:44.101 D/Mono ( 7649): Searching for 'monodroid_free'.
01-17 09:15:44.101 D/Mono ( 7649): Probing 'monodroid_free'.
01-17 09:15:44.101 D/Mono ( 7649): Found as 'monodroid_free'.
01-17 09:15:44.181 D/Mono ( 7649): Assembly Loader probing location: '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Threading.Tasks.dll'.
01-17 09:15:44.181 D/Mono ( 7649): AOT module '/storage/emulated/0/Android/data/App1.Droid/files/.override/System.Threading.Tasks.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Threading.Tasks.dll.so" not found
01-17 09:15:44.181 D/Mono ( 7649): AOT module '/Users/builder/data/lanes/3415/7db2aac3/source/monodroid/builds/install/mono-armv7/lib/mono/aot-cache/arm/System.Threading.Tasks.dll.so' not found: dlopen failed: library "/data/app/App1.Droid-1/lib/arm/libaot-System.Threading.Tasks.dll.so" not found
01-17 09:15:44.181 D/Mono ( 7649): Assembly Ref addref BouncyCastle.Crypto[0xeb183680] -> System.Threading.Tasks[0xeb184ac0]: 4
Thread started: #4
Thread started: #5
01-17 09:15:44.211 D/Mono ( 7649): [0xd82ce930] worker starting
Thread started: #6
01-17 09:15:44.221 D/Mono ( 7649): [0xd81cd930] worker starting
01-17 09:15:44.361 D/Mono ( 7649): [0xd82ce930] hill climbing, change max number of threads 8
01-17 09:15:44.361 D/Mono ( 7649): Assembly Ref addref System.Threading.Tasks.Dataflow[0xeb183bc0] -> System.Threading.Tasks[0xeb184ac0]: 5
01-17 09:15:44.381 W/Mono ( 7649): The class System.Runtime.CompilerServices.ConditionalWeakTable2 could not be loaded, used in System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 01-17 09:15:44.381 W/Mono ( 7649): The class System.Runtime.CompilerServices.ConditionalWeakTable2 could not be loaded, used in System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
01-17 09:16:10.501 D/Mono ( 7649): [0xd81cd930] worker finishing
Thread finished: #6

from opc-ua-samples.

awcullen avatar awcullen commented on May 27, 2024

Here are some things to check..
xamarin versions

android settings

android sdk

from opc-ua-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.