question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build Avalonia on Linux (Debian)

See original GitHub issue

Hi,

following the guide at https://github.com/AvaloniaUI/Avalonia/blob/master/Documentation/build.md , I encounter the following error when performing the “dotnet restore” step on my Debian Buster system:

A compatible installed .NET Core SDK for global.json version [3.1.101] from [/home/tcrass/src/avalonia/global.json] was not found
Install the [3.1.101] .NET Core SDK or update [/home/tcrass/src/avalonia/global.json] with an installed .NET Core SDK:
  3.1.300 [/usr/share/dotnet/sdk]

There seems to be a dotnet version mismatch: The dotnet core version currently installable from https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-debian10 say:

$ dotnet --version
3.1.300

Is there a way to specify the required dotnet version in global.json in a minor-minor-version agnostic way?

Anyway, after manually editing global.json to match the installed dotnet version, I can restore the project. However, when issuing “dotnet run”, the build process throws an error (after printing zillions of warnings):

/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018: Unerwarteter Fehler bei der GenerateExtensionHeaders-Aufgabe. [/home/tcrass  /path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]                
/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018: System.MissingMethodException: Method not found: 'Void System.Xml.Serialization.XmlSerializer.Serialize(System.Xml.XmlWriter, System.Object, System.Xml.Serialization.XmlSerializerNamespaces)'. [/path/to/home/path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]             
/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018:    at SharpGen.CppModel.CppModule.Write(Stream output) [/path/to/home/path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]                       
/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018:    at SharpGen.CppModel.CppModule.Write(String file) [/path/to/home/path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]                         
/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018:    at SharpGenTools.Sdk.Tasks.GenerateExtensionHeaders.Execute(ConfigFile config) [/path/to/home/path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]                                                                                                                            
/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018:    at SharpGenTools.Sdk.Tasks.SharpGenTaskBase.Execute() [/path/to/home/path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]                     
/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/path/to/home/path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]                                                                                                         
/path/to/home/.nuget/packages/sharpgentools.sdk/1.2.1/build/SharpGenTools.Sdk.targets(173,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/path/to/home/path/to/avalonia/working-copy/src/Avalonia.Native/Avalonia.Native.csproj]                                                                                                                     

I reckon this is either a bug or the documentation is outdated?

Cheers –

Torsten

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tcrasscommented, Jun 8, 2020

@tcrass delete obj/Debug/netstandard2.0/SharpGen, you probably have stale files.

Yepp, you were right – cleaning up did help, I can now successfuly build Avalonia! 😃

Still doesn’t work with the latest dotnet core version, though – so the documentation is still misleading.

Cheers –

Torsten

0reactions
xiangzhaicommented, Aug 10, 2020

Hi @kekekeks

Our OSX builds use https://github.com/CastXML/CastXML/archive/v0.2.0.tar.gz

Thanks for your suggestion!

CastXML-v0.2.0 works:

$ castxml --version
castxml version 0.2.0

CastXML project maintained and supported by Kitware (kitware.com).

Loongson clang version 3.9.0 (tags/RELEASE_390/final) (based on LLVM 3.9.0)
Target: mips64el-redhat-linux
Thread model: posix
InstalledDir: 

Thanks, Leslie Zhai

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avalonia/Documentation/build.md at master
Go to https://dotnet.microsoft.com/download/visual-studio-sdks and install the latest version of the .NET Core SDK compatible with Avalonia UI.
Read more >
Avalonia in Windows, Linux Debian and Raspberry Pi
Your browser can't play this video. Learn more.
Read more >
DX11 Rendering on Linux with Avalonia UI. : r/dotnet
r/dotnet - DX11 Rendering on Linux with Avalonia UI. ... r/debian ... Tried my hand at building a news reader app with dotnet...
Read more >
FAQ | Avalonia UI
Yes. You can compile for macOS and Linux from Windows. You'll likely need to package your app on those platforms to create release...
Read more >
AvaloniaLocator Current does not exists Linux
AvaloniaLocator.Current is not a public property and in the docs that I read they all use it. So im trying to update an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found