is there are way to use nuget Packages with dotnet on a raspberry PI without Internet?
I have installed dotnet SDK on a raspberry PI.
I have also installed nuget CLI on raspberry PI.
I am using nuget CLI with mono.
I followed the second Answer from this Question :
dotnet add package with local package file
I created a feed from package. When I enter:
dotnet add package MyPackage -s ./packages
I get this as output:
Writing /tmp/tmp3Ax5wm.tmp
info: Adding PackageRefernce for package 'system.device.gpio' into project '/home/pi/ws/dotnet/testapp.csproject'.
info: Restoring packages for /home/pi/ws/dotnet/testapp.csproject...
error: Unable to load the service index for source https://api.nuget.org/v3/index.json.
error: Resource temporarily unavailable
Somebody has an idea? I coppied the .nupkg with a usb stick on the raspberry pi.
Maybe running a nuget Server on the raspberry pi and push it the local server and install it from there? For example https://github.com/ai-traders/liget ?
Is there a easy way to solve the problem?
I would recommend you add directory with all your packages you need as a local file share. Then you just need to define that local file share as a source in a nuget.config file at the root of your app. Then when you run the command it will check that file share for the package. Much easier to implement then having to host a nuget server.
Here are some docs on it: https://learn.microsoft.com/en-us/nuget/hosting-packages/local-feeds
I would recommend you to not use the .Net core SDK on your raspberry but .Net core Runtime then you can develope your .Net core app on a real PC and publish to a publish folder. During publish .Net core restores all DLLs of nuget packages into the publish folder. After that you can easily copy paste your publish folder on your raspberry and start your app with dotnet yourpath/yourApplicationName.dll in Linux-cli or execute for windows the application.exe in the publish folder.
Related
I'm trying to install MonoGame for mac and VS code. I followed the instructions at https://docs.monogame.net/articles/getting_started/1_setting_up_your_development_environment_macos.html, but I am stuck at one place. I have the monogame editor .mpack file, but can't upload it to VS code for some reason. I did extensive research but can't find any answers. What should I do?
The "normal" Mac install instructions and files are only for use with Visual Studio.
Install using CLI
Please note these instructions are designed for Intel Macs(x64), but should work on Apple Silicon devices(ARM) with .Net6.
You can roughly follow the Linux install instructions.
Install Dot Net Core 3.1 for the Mac. or .Net6
Install VS Code.
You may need to reference this question on Terminal paths for code. Something similar may need to be done below for the dotnet command.
a. Install the C# extensions: code --install-extension ms-dotnettools.csharp
(Optional) Install Mono. Required for some consoles and Android targets(Frameworks 4.5 and 4.7). See here for compatability.
Open a terminal window. Run the following line, either the OS or from VS Code:
dotnet new --install MonoGame.Templates.CSharp
The next two lines may be Linux specific so ignore any uncorrectable errors.
dotnet tool install --global dotnet-mgcb-editor
mgcb-editor --register
At this point, you should be able to create a new CLI project folder from the templates:
cd /path/togame/parent
dotnet new mgdesktopgl -o MyGame
Open the folder in VS Code.
Review the projectname.csproj file:
Note the TargetFramework line:
<TargetFramework>netcoreapp3.1</TargetFramework> or
<TargetFramework>net6.0</TargetFramework>
Some targets require a different TargetFramework, like net47 or net45 as provided by Mono.
See Microsoft's .Net versioning page for more information.
A couple of additional helpful CLI commands to run from the folder with the .proj file; Taken from this list:
dotnet restore Update all NuGet Packages
dotnet clean Remove all output files
dotnet build compile
dotnet run execute the program
I am trying to setup visual studio code for c# on Manjaro Linux
I have installed VSC and .NET core 5.0 SDK through the package manager.
The c# add-on is installed in VSC
With all of these installed correctly, why can't I use the dotnet command in the terminal?
Every time I try I get this error; sh: dotnet: command not found
By default, dotnet is installed to usr/share/dotnet. Check if this path is added to the env var $PATH.
If you can't find it there, you could run on a terminal:
whereis dotnet
If no dotnet is found, the tool wasn't properly installed.
Also, did you close and reopen the terminal window after installing the SDK, as the instructions stated?
I wrote a .net core console application on mac and it's working fine. Then I made a build for ubuntu by using
dotnet build --runtime ubuntu.16.04-x64
the result was:
MyAppName.Server MyAppName.Server.runtimeconfig.dev.json
MyAppName.Server.deps.json MyAppName.Server.runtimeconfig.json
MyAppName.Server.dll libhostfxr.so
MyAppName.Server.pdb libhostpolicy.so
I copied these files on my linux server and run the following command
dotnet MyAppName.Server.dll
And now I getting
Error:
An assembly specified in the application dependencies manifest (MyAppName.Server.deps.json) was not found:
package: 'Ether.Network', version: '2.0.1'
path: 'lib/netstandard1.3/Ether.Network.dll'
Ether.Network is the only package that I using.
From dotnet build's documentation:
If the project has third-party dependencies, such as libraries from NuGet, they're resolved from the NuGet cache and aren't available with the project's built output. With that in mind, the product of dotnet build isn't ready to be transferred to another machine to run.
You want dotnet publish instead:
The dotnet publish command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution and is the only officially supported way to prepare the application for deployment.
Does anyone know how to build a definition for a dotnet core project for IIS using using TFS 2017?
Problem I am having when I build and deploy currently it only produces a container type build which only includes 5 files and no dependencies.
Anyone help?
Sorted. I had to do a msbuild and publish using the msbuild task.
You need to use dotnet command in Command line task to restore the NuGet package and build/publish the output to a folder.
publish -c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory)
After you've run the build, you could create a release definition to deploy your app to an IIS server.
More detail steps please refer below tutorial:
Build your ASP.NET Core app
Deploy your Web Deploy package to IIS servers
Setting up .net core continuous integration build with VSTS/TFS
I developed a SQLite/C# application on Windows and am deploying it on a Ubuntu server.
I downloaded the pre-compiled DLLs for MONO here
https://system.data.sqlite.org/downloads/1.0.104.0/sqlite-netFx451-binary-Mono-2013-1.0.104.0.zip
I downloaded the source code and compiled libSQLite.Interop.so using this script, and then moved libSQLite.Interop.so into the website's bin folder alongside the other DLLs
https://system.data.sqlite.org/index.html/artifact?ci=trunk&filename=Setup/compile-interop-assembly-release.sh
It still complains about System.DllNotFoundException: SQLite.Interop.dll. I tried renaming libSQLite.Interop.so to SQLite.Interop.dll and that doesn't help.
What else do I need to do to get SQLite(EF6) to run on MONO on Ubuntu?
I fix familliar problem by acting as
http://blog.wezeku.com/2016/10/09/using-system-data-sqlite-under-linux-and-mono/
telled.
You may clone source codes, and compile it in specific linux-env.
A shortcut:
Building System.Data.SQLite Interop under Linux
There’s no System.Data.SQLite package for Linux, so you’ll have to build it yourself on your target Linux machine. You can build using this procedure, which is tested in Raspbian Jessie on a Raspberry Pi 3 and Ubuntu 16.04.1 on a PC:
Download System.Data.SQLite full source code from this download page. There’s a ton of files there, and the one you should look for is named something like sqlite-netFx-full-source-<version no>.zip.
Unzip it and transfer it to a directory on your Linux machine. In the rest of this description, I’ll call this directory “<source root>”.
Issue these commands in a Linux terminal:
sudo apt-get update
sudo apt-get install build-essential
cd <source root>/Setup
chmod +x compile-interop-assembly-release.sh
./compile-interop-assembly-release.sh
Now, you will have a freshly built library file called libSQLite.Interop.so in the <source root>/bin/2013/Release/bin directory. This file might have execution permission which isn’t relevant for a library, so remove it by
chmod -x <source root>/bin/2013/Release/bin/libSQLite.Interop.so
Copy libSQLite.Interop.so the directory where your Mono/.NET application’s binaries reside (not the x64 or x86 subdirectories containing SQLite.Interop.dll), and you’re set to go.
And that, ladies and gentlemen, is how we do that!
Do not use the interop version at all, instead stick to the libmono-sqlite4.0-cil package which you probably already have installed. If the sqlite dll is deployed with your application, delete it so the system picks up the packaged version from the GAC.