TensorStack-AI / OnnxStack

C# Stable Diffusion using ONNX Runtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotnet build fails on Linux citing missing build target Microsoft.NET.Sdk.WindowsDesktop.targets

james-s-tayler opened this issue · comments

Hi there, great project and awesome to see you're building on the great work of the C# Onnx Runtime API working to make generative AI more accessible to C# developers, so we don't have to endlessly wade through lots of python code written hastily by academic researchers!

I was keen to see if I can play around with this project and figure out how to add support for other ONNX based models as it seems like the format is really gaining some traction these days. However, I'm running Ubuntu 23.04 and after cloning the project and attempting to run dotnet build I get the following compilation error:

dotnet build

Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.113

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
MSBuild version 17.4.8+6918b863a for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/lib/dotnet/sdk/7.0.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(1226,3): error MSB4019: The imported project "/usr/lib/dotnet/sdk/7.0.113/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" was not found. Confirm that the expression in the Import declaration ";/usr/lib/dotnet/sdk/7.0.113/Sdks/Microsoft.NET.Sdk/targets/../../Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" is correct, and that the file exists on disk. [/home/yolo/source/OnnxStack/OnnxStack.UI/OnnxStack.UI.csproj]
  OnnxStack.Core -> /home/yolo/source/OnnxStack/OnnxStack.Core/bin/Debug/net7.0/OnnxStack.Core.dll
  OnnxStack.StableDiffusion -> /home/yolo/source/OnnxStack/OnnxStack.StableDiffusion/bin/Debug/net7.0/OnnxStack.StableDiffusion.dll
  OnnxStack.Console -> /home/yolo/source/OnnxStack/OnnxStack.Console/bin/Debug/net7.0/OnnxStack.Console.dll
  OnnxStack.WebUI -> /home/yolo/source/OnnxStack/OnnxStack.WebUI/bin/Debug/net7.0/OnnxStack.WebUI.dll

Build FAILED.

/usr/lib/dotnet/sdk/7.0.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(1226,3): error MSB4019: The imported project "/usr/lib/dotnet/sdk/7.0.113/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" was not found. Confirm that the expression in the Import declaration ";/usr/lib/dotnet/sdk/7.0.113/Sdks/Microsoft.NET.Sdk/targets/../../Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" is correct, and that the file exists on disk. [/home/yolo/source/OnnxStack/OnnxStack.UI/OnnxStack.UI.csproj]
    0 Warning(s)
    1 Error(s)

 Time Elapsed 00:00:02.90

I guess it makes sense the WindowsDesktop target is not available on a linux distribution, but it's a shame that's preventing me from compiling it.

yeah, this was due to the addition of the WPF project last week, its not cross-platform so will fail build on mac an linux

I was not planning on making any UI's at all, but ended up adding a basic Web and Desktop UI so people could test

The console and web apps should work fine on linux and mac

Thanks you for the PR, I have merged that in exposing just the core projects