Quantcast

"Could not load file or assembly" on Ubuntu

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"Could not load file or assembly" on Ubuntu

Steve Chadsey
Ubuntu 16.04
Installed monodevelop 6.1.2 via flatpak.

I have a console application that reference System.ServiceModel.  I can successfully build and run the solution via the IDE.  However, when I run the binary from the shell, I get:

Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

I saw an option for the references, "Local Copy".  Setting that for System.ServiceModel and rebuilding would yield the same error, but for a different reference (System.Xml.Linq). If I set "Local Copy" for that one, then I get this horrible mess when running the rebuild binary from the shell:

* Assertion at metadata.c:3643, condition `ptr' not met

Stacktrace:


Native stacktrace:

        /usr/bin/cli() [0x4a77ca]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f3d5e0bb390]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f3d5db00428]
        /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f3d5db0202a]
        /usr/bin/cli() [0x6408d9]
        /usr/bin/cli() [0x640ae7]
        /usr/bin/cli() [0x640c36]
        /usr/bin/cli() [0x56513e]
        /usr/bin/cli() [0x4155a4]
        /usr/bin/cli() [0x4600ba]
        /usr/bin/cli() [0x46ad6a]
        /usr/bin/cli() [0x45659a]
        /usr/bin/cli() [0x504d42]
        /usr/bin/cli() [0x50653f]
        /usr/bin/cli() [0x425332]
        /usr/bin/cli() [0x425ff9]
        /usr/bin/cli(mono_runtime_invoke+0x61) [0x5b5591]
        /usr/bin/cli(mono_runtime_exec_main+0xbf) [0x5b734f]
        /usr/bin/cli(mono_jit_exec+0x9f) [0x478bbf]
        /usr/bin/cli(mono_main+0x1230) [0x47a1e0]
        /usr/bin/cli() [0x421818]
        /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f3d5daeb830]
        /usr/bin/cli() [0x421c11]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No threads.

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted (core dumped)

I did not have these issues when using monodevelop that was installed via the Ubuntu package manager.  How do I resolve this, besides reverting to the old version of monodevelop?

Thanks,


--
Steve Chadsey <[hidden email]>

_______________________________________________
Monodevelop-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/monodevelop-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Could not load file or assembly" on Ubuntu

knocte
On Saturday, March 25, 2017 07:40 AM, Steve Chadsey wrote:
> * Assertion at metadata.c:3643, condition `ptr' not met

That assertion seems to suggest a bug in mono. What version of mono are
you using?

_______________________________________________
Monodevelop-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/monodevelop-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Could not load file or assembly" on Ubuntu

Steve Chadsey
On Fri, Mar 31, 2017 at 8:06 AM, Andres <[hidden email]> wrote:
>
> On Saturday, March 25, 2017 07:40 AM, Steve Chadsey wrote:
>>
>> * Assertion at metadata.c:3643, condition `ptr' not met
>
>
> That assertion seems to suggest a bug in mono. What version of mono are you using?

$ mono --version
Mono JIT compiler version 4.4.2 (Stable 4.4.2.11/f72fe45 Fri Jul 29 09:58:49 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

--
Steve Chadsey <[hidden email]>

_______________________________________________
Monodevelop-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/monodevelop-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Could not load file or assembly" on Ubuntu

knocte
On Friday, March 31, 2017 10:14 PM, Steve Chadsey wrote:

> On Fri, Mar 31, 2017 at 8:06 AM, Andres <[hidden email]
> <mailto:[hidden email]>> wrote:
>>
>> On Saturday, March 25, 2017 07:40 AM, Steve Chadsey wrote:
>>>
>>> * Assertion at metadata.c:3643, condition `ptr' not met
>>
>>
>> That assertion seems to suggest a bug in mono. What version of mono
> are you using?
>
> $ mono --version
> Mono JIT compiler version 4.4.2 (Stable 4.4.2.11/f72fe45

That's not the version that ships by default in Ubuntu16.04. Then I
would recommend you either:


a) Downgrade to distro packages (4.2.1), hopefully more stable.

OR

b) Upgrade mono to 4.8.


If after (a) it still fails, do (b).
If after (b) it still fails, file a runtime bug in
http://bugzilla.xamarin.com

_______________________________________________
Monodevelop-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/monodevelop-list
Loading...