Uno: [Linux] FileLoadException: Could not load file or assembly Newtonsoft.Json

Created on 7 May 2020  Â·  21Comments  Â·  Source: unoplatform/uno

Building under Linux generates this error:

$ î‚° dotnet build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restore completed in 28.56 ms for /home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj.
unoTestBed.Wasm -> /home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/bin/Debug/netstandard2.0/unoTestBed.Wasm.dll
/home/esqueleto/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/build/Uno.Wasm.Bootstrap.targets(124,5): error : System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Could not find or load a specific file. (0x80131621) [/home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj]
/home/esqueleto/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/build/Uno.Wasm.Bootstrap.targets(124,5): error : File name: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' [/home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj]
/home/esqueleto/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/build/Uno.Wasm.Bootstrap.targets(124,5): error : at Uno.Wasm.Bootstrap.ShellTask_v4ccfd1daded8808c1c60acf351657c5d5caa7ea2.GeneratePWAContent(StringBuilder extraBuilder) [/home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj]
/home/esqueleto/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/build/Uno.Wasm.Bootstrap.targets(124,5): error : at Uno.Wasm.Bootstrap.ShellTask_v4ccfd1daded8808c1c60acf351657c5d5caa7ea2.GenerateHtml() in D:a1\s\src\Uno.Wasm.Bootstrap\ShellTask.cs:line 1238 [/home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj]
/home/esqueleto/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/build/Uno.Wasm.Bootstrap.targets(124,5): error : at Uno.Wasm.Bootstrap.ShellTask_v4ccfd1daded8808c1c60acf351657c5d5caa7ea2.Execute() in D:a1\s\src\Uno.Wasm.Bootstrap\ShellTask.cs:line 172 [/home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj]
/home/esqueleto/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/build/Uno.Wasm.Bootstrap.targets(124,5): error : [/home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj]
/home/esqueleto/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/build/Uno.Wasm.Bootstrap.targets(124,5): error : [/home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm/unoTestBed.Wasm.csproj]

_Originally posted by @aboimpinto in https://github.com/unoplatform/uno/issues/1947#issuecomment-625478265_

kinbug platforlinux

All 21 comments

Let's continue this issue here, as it's not the same error as previously. Looks like there is a missing piece there, which could be casing related. I'll investigate.

What does dotnet --version give you ?

no problem .. as soon as you have something .. I will give you fast feedback

$ dotnet --version
3.1.101

$ mono --version
Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 UTC 2020)
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
Interpreter: yes
LLVM: supported, not enabled.
Suspend: hybrid
GC: sgen (concurrent by default)

We're testing this on the CI, and tested again locally, and I'm not getting this error. I wonder if it could be caused by mono 6.8. I'll update to the same version you have and check :)

It's definitely not mono version either. There's something that does not add up here...

Does the file ~/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/tools/Newtonsoft.Json.dll exist on your system ?

yes
image

Can you try updating to 1.2.0-dev.39 and see if this works ?

Hello ...
still have the same issue ...
This time I try to dig a little bit on the issue and I notice that is trying to load Newtonsoft.Json, Version=12.0.0.0, but in the nuget page of Newton there is no version 12.0.0.0

maybe there was one but doesn't anymore

this could be the issue?

The file in question (~/.nuget/packages/uno.wasm.bootstrap/1.2.0-dev.37/tools/Newtonsoft.Json.dll) is of version 12.0.0.0, and it is supposed to be loaded with the tooling. Could you run dotnet build /bl and share the binlog file ?

msbuild.binlog.zip

here it is!

The only part that is very different is the dotnet version. I'm running 3.1.201, I know a few things changed there, like the build engine Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core. Could you try updating it as well ?

going to try to update ... having problems install zlib to run the update script ...
how did you install it?

I'm using it through this base image, that may help: https://github.com/unoplatform/docker/blob/master/wasm-build/Dockerfile

On the docker hub: https://hub.docker.com/layers/unoplatform/wasm-build

GitHub
template for brand new github repositories. Contribute to unoplatform/docker development by creating an account on GitHub.

I'm using the ubuntu directly .. not a docker image ..
going to give some love to this issue later

I was mentioning the script as the mono installation is provided there, but as for the zlib, what error message are you having ? I can't recall which library I installed at the time.

YES!!!!

$ î‚° ~/dotnet/dotnet run
Hosting environment: Production
Content root path: /home/esqueleto/myDevelop/unoTestBed/unoTestBed.Wasm
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.

Was the version of the dotnet

I install the dotnet from source .. there 3.1.201 from the source ... the one in the ubuntu repositories is the 3.1.101 version and doesn't work.

I'm living the Silverlight time again .. my XAML apps can run on the Web again ...

IT'S ALIVE!!!
Thanks

now .. the installation process needs to smother... ;)

Yes, that's definitely needed to be smoother :)

Looks like msbuild got fixed in between versions, so that's good news.

Thanks for the troubleshooting !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JanabiSoft picture JanabiSoft  Â·  4Comments

TonyHenrique picture TonyHenrique  Â·  3Comments

PylotLight picture PylotLight  Â·  3Comments

MartinZikmund picture MartinZikmund  Â·  3Comments

MartinZikmund picture MartinZikmund  Â·  4Comments