Comments (17)
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:
from llamasharp.
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.
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.
- open the WinForms Solution that is using LLamaSharp
- (re)build the Solution in order to create the .exe or .dll
- View... Solution Explorer... (Ctrl Alt L)
- right-click on the name of Solution -> Add -> New Project... Setup Project: Create a Windows Installer project to which files can be added
- right-click on the name of Setup project -> View -> File System
- right-click on Application Folder -> Add -> Projct Output... Primary Output
- in Solution Explorer, under the name of Setup Project, appears: "Detected Dependencies" and "Primary output from [name of Solution]
- 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
- right-click again on "Application Folder" - to add LLamaSharp.dll
- Add -> Assembly...
- Browse... to file LLamaSharp.dll
- I use the LLamaSharp.dll in [Solution name]\bin\Release"net 8.0-windows
- Visual Studio crashes
- restart it
- rebuild the Solution using LLamaSharp
- repeat steps 7 (add the Primary Output = no dependencies) to 11 (add LLamaSharp.dll)
- 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"
- build the entire solution: the Solution using LLamaSharp.dll and the Setup project:
- in Solution Explorer: right-click on the name of the whole solution ("2 of 2 projects"): Rebuild Solution
- 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.
(sorry - the many Edits were mostly for misspelled words)
from llamasharp.
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.
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:
- install the Microsoft.SemanticKernel as indicated at:
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/README.md - build the Solution that is using LLamaSharp.dll
- create a Setup Project ->
- View -> File System
- to the "Application Folder":
- Add -> Assembly -> the EXECUTABLE file of the LLamaSharp solution: blabla.exe
- 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
- the Dependencies of these^ DLLs are being detected and Added to the "Application Folder" as well.
- rebuild the entire Solution: the (WinForms) App and the Setup Project
- run the .msi installer on the (other) computer
- in the folder where it was installed, check on the presence of all packaged^ .dlls - they should be there
- launch the App.exe - it should start
from llamasharp.
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.
There's a delay of message so plz ignore my last comment. Thank you for providing the solution!
from llamasharp.
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
from llamasharp.
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.
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.
from llamasharp.
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.
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.
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.
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.
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.
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)
- Nuget references both CPU and CUDA simultaneously HOT 2
- Thread Safety in llama.cpp HOT 1
- Llama.web app published into iis windows 64bit server, after deployment model values not loaded from appsettings HOT 3
- Not able to read fields from appsetings.json HOT 3
- Examples don't run with CUDA12 HOT 17
- Consider adding Windows on ARM build of llama.dll to LLamaSharp.Backend.Cpu HOT 4
- Drastic CUDA compute speed drop in last version HOT 13
- Build CUDA with AVX HOT 2
- Fatal error. System.Runtime.InteropServices.SEHException HOT 32
- Godot game engine example HOT 7
- how to prevent the llama from completing requests HOT 1
- about NVidia GPU use example HOT 4
- SemanticKernel ChatCompletion is Stateless HOT 5
- Segmentation fault on Docker HOT 2
- [LLamaSharp.Backend.Cuda12 v0.10.0] Unable to load the model onto multiple GPUs HOT 3
- Unable to use lora in llamasharp but can use it in llama.cpp HOT 8
- AMD GPUs Support
- Exception error when sending any prompts. HOT 7
- Parallel Inferencing? HOT 27
- Information on new important updates in llama.cpp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llamasharp.