GithubHelp home page GithubHelp logo

Comments (17)

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024 1

it works that^ way, too:

  • in the setup project -> File System -> ONLY ADDED:
  • LLamaSharp.dll
  • programname.DLL
  • programname.EXE
  • Rebult the setup project
  • installed on another computer
  • launched the EXE, it worked
    For what it's worth, an image with the contents of the folder where the program was installed:

imgls4

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on June 17, 2024

Hi, will the building succeed if you remove LLamaSharp and add microsoft semantic-kernel as dependency for example?

I've Added a Setup project to the solution, in order to deploy the working application to another computer which may not have .NET 8/6 on it.

Sorry but I know little about the distribution of .NET applications. Could you please tell more about what the Setup project is?

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

Hello.

Thank you.

Let's try it thatta way then.

All I do with LLamaSharp (regardless of its version) is in Microsoft Visual Studio 2022 Community >= 17.9.1

I have installed the MS Semantic Kernel as per the instructions here:
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/README.md

Semantic Kernel does not appear in the list of known Type Libraries, as to be selected and added as a Dependency, so:
I Browsed to it in the place where NuGet put it:

  • Microsoft.SemanticKernel.Abstractions - refers .NET 2.0
    -- and it does appear under "Dependencies/Assemblies" of the Solution, but the results below are the same.
  • Microsoft.SemanticKernel - also refers .NET 2.0
    -- and it does appear too under "Dependencies/Assemblies" of the Solution, but the results below are the same.
  1. open the WinForms Solution that is using LLamaSharp
  2. (re)build the Solution in order to create the .exe or .dll
  3. View... Solution Explorer... (Ctrl Alt L)
  4. right-click on the name of Solution -> Add -> New Project... Setup Project: Create a Windows Installer project to which files can be added
  5. right-click on the name of Setup project -> View -> File System
  6. right-click on Application Folder -> Add -> Projct Output... Primary Output
  7. in Solution Explorer, under the name of Setup Project, appears: "Detected Dependencies" and "Primary output from [name of Solution]
  8. The "Detected Dependencies" folder is empty; also, the "Application Folder" does not contain anything resembling a Dependency, such as a .dll - it should, as Dependencies of an .exe/.dll are automatically detected
  9. right-click again on "Application Folder" - to add LLamaSharp.dll
  10. Add -> Assembly...
  11. Browse... to file LLamaSharp.dll
  12. I use the LLamaSharp.dll in [Solution name]\bin\Release"net 8.0-windows
  13. Visual Studio crashes
  14. restart it
  15. rebuild the Solution using LLamaSharp
  16. repeat steps 7 (add the Primary Output = no dependencies) to 11 (add LLamaSharp.dll)
  17. in Solution Explorer, under the name of Setup Project, in the folder "Detected Dependencies" appear "Microsoft.Extensions.DependencyInjection.Abstractions.dll" and "Microsoft.Extensions.Logging.Abstractions.dll"
  18. build the entire solution: the Solution using LLamaSharp.dll and the Setup project:
  19. in Solution Explorer: right-click on the name of the whole solution ("2 of 2 projects"): Rebuild Solution
  20. in the Output window, the same announcements appear:
    ------ Starting pre-build validation for project 'blabla_setup' ------
    WARNING: Unable to find dependency 'SYSTEM.COLLECTIONS' (Signature='B03F5F7F11D50A3A' Version='8.0.0.0') of assembly 'Microsoft.Extensions.Logging.Abstractions.dll'
    WARNING: Unable to find dependency 'SYSTEM.THREADING' (Signature='B03F5F7F11D50A3A' Version='8.0.0.0') of assembly 'Microsoft.Extensions.Logging.Abstractions.dll'
    WARNING: Unable
    [...]
    Building file 'H:... ...\blabla_setup.msi'...
    WARNING: Including primary output of project 'blabla.csproj' with target framework '.NETCoreApp v8.0' may result in incomplete content. See here: https://go.microsoft.com/fwlink/?linkid=2112157
    Packaging file 'Microsoft.Extensions.Logging.Abstractions.dll'...
    Packaging file 'Microsoft.Extensions.DependencyInjection.Abstractions.dll'...
    Packaging file 'blabla.runtimeconfig.json'...
    Packaging file 'LLamaSharp.dll'...
    Packaging file 'blabla.dll'...
    ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

The blabla.exe is not there. Nor the expected Dependencies of Abstractions...
I don't know what blabla.dll is and what it does, if anything. Nor do I care.

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

(sorry - the many Edits were mostly for misspelled words)

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

Now - adding the Microsoft.SemanticKernel.Abstractions.dll as an Assembly:

Solution Explorer -> File System -> Application Folder

right-click -> Add -> Assembly
Browse... to file
C;... ...\nuget\packages\microsoft.semantickernel.abstractions\1.5.0\lib\netstandard2.0
choose the file:
Microsoft.SemanticKernel.Abstractions.dll

This is being Added to the "Application FoldeR" along with

  • seemingly all its Dependencies
  • which appear to be sufficient for the Setup Solution to be Built:
    (although with Warnings that the files are under File Protection)

Packaging file 'netstandard.dll'...
Packaging file 'System.Security.SecureString.dll'...
Packaging file 'Microsoft.Extensions.Logging.Abstractions.dll'...
Packaging file 'Microsoft.SemanticKernel.Abstractions.dll'...
Packaging file 'System.Xml.XPath.XDocument.dll'...
Packaging file 'System.Runtime.InteropServices.RuntimeInformation.dll'...
Packaging file 'System.ValueTuple.dll'...
Packaging file 'System.Net.Http.dll'...
Packaging file 'System.Net.Sockets.dll'...
Packaging file 'Microsoft.Extensions.DependencyInjection.Abstractions.dll'...
Packaging file 'System.Runtime.Serialization.Primitives.dll'...
Packaging file 'System.Data.Common.dll'...
Packaging file 'sinforma.runtimeconfig.json'...
Packaging file 'System.Security.Cryptography.Algorithms.dll'...
Packaging file 'System.Threading.Overlapped.dll'...
Packaging file 'System.Diagnostics.StackTrace.dll'...
Packaging file 'System.IO.Compression.FileSystem.dll'...
Packaging file 'System.IO.Compression.dll'...
Packaging file 'LLamaSharp.dll'...
Packaging file 'System.Runtime.Serialization.Xml.dll'...
Packaging file 'blabla.dll'...
Packaging file 'System.Diagnostics.Tracing.dll'...
Packaging file 'System.Globalization.Extensions.dll'...
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

The issue was SOLVED this way:

Thank you! to AsakusaRinne here.

To create a Setup project resulting in a .msi file which can be used to install the (WinForms) App (onto another computer with .NET 8.0/6.0):

Visual Studio Community 2022 17.9.1:

  1. install the Microsoft.SemanticKernel as indicated at:
    https://github.com/microsoft/semantic-kernel/blob/main/dotnet/README.md
  2. build the Solution that is using LLamaSharp.dll
  3. create a Setup Project ->
  4. View -> File System
  5. to the "Application Folder":
  6. Add -> Assembly -> the EXECUTABLE file of the LLamaSharp solution: blabla.exe
  7. Add -> Assembly: Browse... to the
    Microsoft.SemanticKernel.Abstractions.dll
    (it usually is in the C:\Users\username.nuget\packages\microsoft.semantickernel\1.5.0\lib\

then, possibly in:

\netstandard2.0\

as the file:
Microsoft.SemanticKernel.Abstractions.dll

7.1. Microsoft.SemanticKernel.dll should also be Added

  1. the Dependencies of these^ DLLs are being detected and Added to the "Application Folder" as well.
  2. rebuild the entire Solution: the (WinForms) App and the Setup Project
  3. run the .msi installer on the (other) computer
  4. in the folder where it was installed, check on the presence of all packaged^ .dlls - they should be there
  5. launch the App.exe - it should start

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on June 17, 2024

Thank you for so much detailed information! I'll try to reproduce this issue.

Two more questions please. Which files should be existed if all things go well? And is console program able to reproduce it?

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on June 17, 2024

There's a delay of message so plz ignore my last comment. Thank you for providing the solution!

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

Strike that...

You might as well delete the posts above.

It does not work.

wtx

The Dependencies are packaged and deployed, but
The messages are still there. Didn't see them :(

Back to square 1.5

  • only a part of Dependencies are resolved,
  • not those to components of .NET
    imgls1

imgls2

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

The .exe

  • will open/run/launch when /double-clicked on the computer where it has been built/installed
  • will open/run/launch when /double-clicked on the computer where it has been built and deployed/installed
  • will not open/run/launch when /double-clicked on a computer where it has been deployed/installed

.NET 8 SDK is installed on both computers.

Beats me.

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

On another computer

  • I've installed the SemanticKernel via NuGet in VS2022
  • I've COPIED the contents of the bin/Release folder of the application
  • which WILL run as a result of this shameful deployment
  • which WILL NOT run if the DLL named like the EXE is deleted from this folder (see image below: sinforma.dll)

Don't know if this has to do with the presence of the SemanticKernel package in the nuget directory on this another computer; nor do I know what's in the DLL named like the EXE.

Beats me a-gin.

imgls3

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

I need /some fresh air.

Air Antarctica, or Mars even /calling Elon for a ticket on his sh!p.

At least it works again.

I shall delete the steps above, about the deployment via setup program, and insert them below this post.

In Visual Studio:

  • to the setup package in the "Application Folder":
    -- aside from the .exe of the Application, the .dll named the same MUST be Added too
  • the setup .msi
    -- will be built WITH THE SAME WARNINGS about the impossiblity to resolve dependencies to Collections, Json and the rest in .NET 8.0
    -- but it will deploy the .dll along with the .exe, this DLL being essential for the .exe to run, Forrest, run.

So I guess this issue may be Closed a-gin.

This HAS TO be tested to deth, some feedback from the community would do a whole lotta good...

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on June 17, 2024

It seems that we had misunderstandings at the beginning, sorry for the confusion. :)

Let's clear it together. You had a winform app depending on LLamaSharp and you found it unable to be distributed correctly because some files/dependencies are not dealt with correctly when building the project.

will the building succeed if you remove LLamaSharp and add microsoft semantic-kernel as dependency for example?

I meant that you could try building without LLamaSharp but with another arbitrary library to see if it's a problem due to LLamaSharp. Installing semantic-kernel is not expected to fix anything.

If it's indeed a problem related to LLamaSharp, then please put the log and output files list here, which will help us to fix the problem.

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

As far as I'm concerned, it is you! who provided the solution.

All's well that ends well... the "issue" remains with Documenting the creation of such a Setup file.

In order for an App which is using LLamaSharp to be packaged and deployed/installed on any computer with .NET 8.0/6.0, at this moment - it would be useful if results of tests by the community would be shown here - the steps to build such a setup .msi are:

In Visual Studio 2022 (Community 17.9.1)

  • Build the App - as an EXE, presumably
  • Add a Setup Project to its Solution
  • wherein the Setup project:
    -- to the "Application Folder": add manually LLamaSharp.dll (it should be in the Release or the Debug folder of the program)
    -- to the "Application Folder": add manually the EXE of the program
    -- to the "Application Folder": add manually the DLL with the same name as the EXE
    --- or: Add -> Project Output -> Primary Output (it's the same DLL)

    -- to the "Application Folder": add manually: Microsoft.SemanticKernel
    -- to the "Application Folder": add manually: Microsoft.SemanticKernel.Abstractions
    -- to the "Application Folder", added automatically by VS2022: the DLLs of the Dependencies of .Abstractions, after adding the SemanticKernel^

The .msi will deploy these files and the .exe should run; repeat,

  • .NET 8.0/6.0 must exist on the "destination" computer
  • the DLL named the same as the EXE must be in the folder with the EXE and the other DLLs-Dependencies.

Sheesh.

Thank you heartily!

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on June 17, 2024

Though I'm still a bit confused by why adding semantic-kernel makes everything okay, I'm happy that your project finally works!

If there's any other related problem in the future, please feel free to reopen this issue or open a new issue. :)

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

It is possible, I daresay probable, that the program would be deployed as functional if someone, without installing the Semantic Kernel, only Adds to the setup project the EXE as an Assembly/File along with the Primary Output which seems to be the DLL.

This is why some more testing is needed. Afterwards, a proper guide; not a statistics on 2 computers configured the same...

Perhaps someone will indeed run a test under these conditions:

  • absence of Semantic Kernel
  • to the setup package -> File System -> Add -> Assembly/File: the .exe of the program and the .dll both named the same
  • build, deploy /somewhere, launch the .exe, see if it works

from llamasharp.

SINAPSA-IC avatar SINAPSA-IC commented on June 17, 2024

Looks like the Problem may be very simple: the addition of the EXE to the setup package.

And the warning messages (cannot resolve dependencies, package incomplete) may be ignored. Right. Why would they, in this case /only, and not everytime, with other programs certainly more complex (this one has only 1 dialog with a few Controls and ~50 lines of code)?

Usually (reads: I was fooled by this whatchamacallit), by Primary Output of a /WinForms application, VS means the EXE - not in this case, though, where it took the DLL as Primary Output (it may be a .NET 8 thing), whereas the EXE had to be added manually, although it is the sine-qua-non part of the plot.

More testing is still welcome; LLamaSharp programs will be deployed all around.

Still - sorted out.

from llamasharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.