sudo code --user-data-dir="~/.vscode-root"
tutorials, tips, tricks, commands, programming, linux, windows, database, sql, python, programming language, Fedora, drawing, painting, tutorial, tutorials
Showing posts with label Visual Code. Show all posts
Showing posts with label Visual Code. Show all posts
Friday, December 25, 2020
Fedora 33 : Use Visual Code on root account.
Sometimes creating or modifying files that have root permissions is required.
I use the following command to run Visual Code with these permissions:
Posted by
Cătălin George Feștilă
Labels:
2020,
Fedora,
Fedora 33,
linux,
linux tools,
tutorial,
tutorials,
Visual Code
Thursday, December 3, 2020
Fedora 33 : Create a simple AvaloniaUI window.
This tutorial is about Avalonia UI.
Avalonia is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows via .NET Framework and .NET Core, Linux via Xorg, macOS.
I install avalonia dotnet templates from here:
[mythcat@desk CSharpProjects]$ git clone https://github.com/AvaloniaUI/avalonia-dotnet-templates --recursive
Cloning into 'avalonia-dotnet-templates'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 379 (delta 14), reused 19 (delta 7), pack-reused 342
Receiving objects: 100% (379/379), 147.23 KiB | 881.00 KiB/s, done.
Resolving deltas: 100% (202/202), done.
[mythcat@desk CSharpProjects]$ ls
aspnetapp avalonia-dotnet-templates HelloWorld myapp001 MyGame001 Todo
[mythcat@desk CSharpProjects]$ dotnet new --install avalonia-dotnet-templates
...
Create a default window example with AvaloniaUI:
[mythcat@desk CSharpProjects]$ dotnet new avalonia.app -o MyAppAvalonia
The template "Avalonia .NET Core App" was created successfully.
[mythcat@desk CSharpProjects]$ cd MyAppAvalonia/
[mythcat@desk MyAppAvalonia]$ dotnet add package Avalonia
...
[mythcat@desk MyAppAvalonia]$ dotnet add package Avalonia.Desktop
...
[mythcat@desk MyAppAvalonia]$ ls
App.xaml App.xaml.cs MainWindow.xaml MainWindow.xaml.cs MyAppAvalonia.csproj nuget.config Program.cs
Publish this example:
[mythcat@desk MyAppAvalonia]$ dotnet publish --configuration Release --runtime fedora.33-x64 --self-contained false
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 3.86 sec for /home/mythcat/CSharpProjects/MyAppAvalonia/MyAppAvalonia.csproj.
MyAppAvalonia -> /home/mythcat/CSharpProjects/MyAppAvalonia/bin/Release/netcoreapp3.0/fedora.33-x64/MyAppAvalonia.dll
MyAppAvalonia -> /home/mythcat/CSharpProjects/MyAppAvalonia/bin/Release/netcoreapp3.0/fedora.33-x64/publish/
The last step is the run:
[mythcat@desk MyAppAvalonia]$ dotnet /home/mythcat/CSharpProjects/MyAppAvalonia/bin/Release/netcoreapp3.0/
fedora.33-x64/publish/MyAppAvalonia.dll
This will open a window build with AvaloniaUI.
Posted by
Cătălin George Feștilă
Labels:
.NET Core SDK,
2020,
Avalonia UI,
C#,
Fedora,
Fedora 33,
game development,
game engine,
linux,
linux tools,
tutorial,
tutorials,
Visual Code
Monday, November 30, 2020
Fedora 33 : Build and publish with .NET Core SDK .
In this tutorial I will show you how can use .NET Core SDK to build and run a simple MyGame001 application from the last tutorial.
Let's go to the project and get some infos:
Let's go to the project and get some infos:
[mythcat@desk ~]$ cd CSharpProjects/
[mythcat@desk CSharpProjects]$ cd MyGame001/
[mythcat@desk MyGame001]$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.109
Commit: 32ced2d411
Runtime Environment:
OS Name: fedora
OS Version: 33
OS Platform: Linux
RID: fedora.33-x64
Base Path: /usr/lib64/dotnet/sdk/3.1.109/
Host (useful for support):
Version: 3.1.9
Commit: 774fc3d6a9
.NET Core SDKs installed:
3.1.109 [/usr/lib64/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.9 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.9 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
The next command will create MyGame001.dll.
[mythcat@desk MyGame001]$ dotnet publish --configuration Release --runtime fedora.33-x64 --self-contained false
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 50.58 ms for /home/mythcat/CSharpProjects/MyGame001/MyGame001.csproj.
MyGame001 -> /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/MyGame001.dll
MyGame001 -> /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/publish/
Now you can run it with dotnet command:
[mythcat@desk MyGame001]$ dotnet /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/MyGame001.dll
You can simply run it like an Linux application:
[mythcat@desk MyGame001]$ /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/publish/MyGame001
Posted by
Cătălin George Feștilă
Labels:
.NET Core SDK,
2020,
C#,
Fedora,
Fedora 33,
game development,
game engine,
linux,
linux tools,
MonoGame,
tutorial,
tutorials,
Visual Code
Saturday, November 28, 2020
Fedora 33 : Install and test with MonoGame .NET library .
MonoGame is a simple and powerful .NET library for creating games for desktop PCs, video game consoles, and mobile devices.
Today I tested with Fedora 33.
First let's install this templates for .NET Core CLI and the Rider IDE.:
Today I tested with Fedora 33.
First let's install this templates for .NET Core CLI and the Rider IDE.:
[mythcat@desk ~]$ dotnet new --install MonoGame.Templates.CSharp
Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.109
----------------
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Find out what's new: https://aka.ms/dotnet-whats-new
Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
Write your first app: https://aka.ms/first-net-core-app
--------------------------------------------------------------------------------------
Getting ready...
Restore completed in 2.76 sec for /home/mythcat/.templateengine/dotnetcli/v3.1.109/scratch/restore.csproj.
...
Install MGCB Editor is a tool for editing .mgcb files:[mythcat@desk ~]$ dotnet tool install --global dotnet-mgcb-editor
You can invoke the tool using the following command: mgcb-editor
Tool 'dotnet-mgcb-editor' (version '3.8.0.1641') was successfully installed.
[mythcat@desk ~]$ mgcb-editor --register
Installing icon...
Installation complete!
Installing mimetype...
gtk-update-icon-cache: No theme index file.
Installation complete!
Installing application...
Installation complete!
Registered MGCB Editor!
Install C# extension for code editor:[mythcat@desk ~]$ code --install-extension ms-dotnettools.csharp
Installing extensions...
Extension 'ms-dotnettools.csharp' is already installed.
The next step is to create new MonoGame projects:
[mythcat@desk ~]$ cd CSharpProjects/
[mythcat@desk CSharpProjects]$ dotnet new mgdesktopgl -o MyGame001
The template "MonoGame Cross-Platform Desktop Application (OpenGL)" was created successfully.
An update for template pack MonoGame.Templates.CSharp::3.8.0.1641 is available.
install command: dotnet new -i MonoGame.Templates.CSharp::3.8.0.1641
I run the default template and working well:
[mythcat@desk CSharpProjects]$ cd MyGame001
[mythcat@desk MyGame001]$ ls
app.manifest Content Game1.cs Icon.bmp Icon.ico MyGame001.csproj Program.cs
[mythcat@desk MyGame001]$ dotnet run Program.cs
The default source code from Program.cs file is this:using System;
namespace MyGame001
{
public static class Program
{
[STAThread]
static void Main()
{
using (var game = new Game1())
game.Run();
}
}
}
Posted by
Cătălin George Feștilă
Labels:
2020,
C#,
Fedora,
Fedora 33,
game development,
game engine,
linux,
linux tools,
MonoGame,
tutorial,
tutorials,
Visual Code
Saturday, October 17, 2020
Fedora 32 : Visual Code and C# on Fedora distro.
Today I will show you how to use Visual Code with C#.
Created a folder named CSharpProjects and using the linux terminal execute the following command:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/
vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" >
/etc/yum.repos.d/vscode.repo'
Then use dnf to check and install this editor.#dnf check-update
#dnf install code
Use Extensions button or Ctrl+Shift+X keys to open in the left side area and intall the C# extension from Microsoft by pressing the Install button, see:Created a folder named CSharpProjects and using the linux terminal execute the following command:
[mythcat@desk CSharpProjects]$ dotnet new mvc -au None -o aspnetapp
The template "ASP.NET Core Web App (Model-View-Controller)" was created successfully.
This template contains technologies from parties other than Microsoft,
see https://aka.ms/aspnetcore/3.1-third-party-notices for details.
Processing post-creation actions...
Running 'dotnet restore' on aspnetapp/aspnetapp.csproj...
Restore completed in 112.76 ms for /home/mythcat/CSharpProjects/aspnetapp/aspnetapp.csproj.
Restore succeeded.
[mythcat@desk CSharpProjects]$ cd aspnetapp/
[mythcat@desk aspnetapp]$ code .
This command will open the Visual Code.
At this point, in the aspnetapp folder is an ASP.NET project open in Visual Code.
You can run this project with command:
[mythcat@desk aspnetapp]$ dotnet run
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {4c284989-9a5d-4ea7-89e2-a383828fd7ab} may be persisted
to storage in unencrypted form.
info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: /home/mythcat/CSharpProjects/aspnetapp
You can open the https://localhost:5001/ and see the default Welcome page from ASP.NET.
Posted by
Cătălin George Feștilă
Labels:
2020,
ASP.NET,
C#,
development,
dotnet,
Fedora,
Fedora 32,
linux,
linux tools,
programming,
tool,
tools,
tutorial,
tutorials,
Visual Code
Subscribe to:
Posts (Atom)