Question about ConsoleProgressStatus as subclass of System.MarshalByRefObject
santiago-ribero opened this issue · 0 comments
santiago-ribero commented
Hello. We are using Mono.Addins 1.3.7
.
One of our users reported a problem that is logged as:
First error message:
Add-in scan operation failed. The runtime may have encountered an error while trying to load an assembly.
Second error message:
Add-in scan operation failed System.Runtime.Remoting.RemotingException: The argument type 'System.MarshalByRefObject' cannot be converted into parameter type 'Mono.Addins.IProgressStatus'. ---> System.InvalidCastException: Object must implement IConvertible.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
Apparently what is happening is:
- An Exception is thrown in
RemoteSetupDomain.Scan
(for an unknown reason). - The Exception is catched in AddinDatabase.RunScannerProcess , and the first error message is logged.
- A second Exception (InvalidCastException) occurs in that same catch, more precisely when the following is executed:
scanMonitor = new ConsoleProgressStatus (true);
I see that on 14-Jul-2021, the commit 847c4a1#diff-5aaae4188077feb93880e8c3d56ce290c4da0e26d1179300cb71e6e9eed33e7f makes ConsoleProgressStatus
a subclass of MarshalByRefObject
only under the following condition: "#if NETFRAMEWORK
" .
My questions:
- Would you mind telling me if that change is meant to solve the
InvalidCastException
that I described? - Would it be possible for you to give me some hint on how I can reproduce (as a
Mono.Addins 1.3.7
user) theInvalidCastException
that I described? (since all I have is a log file from a final user). - The DLL I am using is "Mono.Addins.1.3.7\lib\net45\Mono.Addins.dll" , with
TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
. I understand that by upgrading to the latest version (with the preprocessor directive), theConsoleProgressStatus
would still be a subclass ofMarshalByRefObject
. Am I right?
Thank you very much. Any hint or advice would be much appreciated.
Kind regards.