Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info
root@Jdotnet6-112:~# dotnet --version
6.0.112
root@Jdotnet6-112:~# dotnet sdk check
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.112
----------------
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
--------------------------------------------------------------------------------------
.NET SDKs:
Version Status
------------------------
6.0.112 Up to date.
Try out the newest .NET SDK features with .NET 7.0.101.
.NET Runtimes:
Name Version Status
------------------------------------------------------
Microsoft.AspNetCore.App 6.0.12 Up to date.
Microsoft.NETCore.App 6.0.12 Up to date.
#2. Checking console, solution and project commands:
root@Jdotnet6-112:~# dotnet new console --name TheTesting
The template "Console App" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on /root/TheTesting/TheTesting.csproj...
Determining projects to restore...
Restored /root/TheTesting/TheTesting.csproj (in 92 ms).
Restore succeeded.
root@Jdotnet6-112:~# cd TheTesting/
root@Jdotnet6-112:~/TheTesting# dotnet new sln
The template "Solution File" was created successfully.
root@Jdotnet6-112:~/TheTesting# dotnet sln TheTesting.sln add TheTesting.csproj
Project `TheTesting.csproj` added to the solution.
root@Jdotnet6-112:~/TheTesting# dotnet build TheTesting.sln
Microsoft (R) Build Engine version 17.0.1+b177f8fa7 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
TheTesting -> /root/TheTesting/bin/Debug/net6.0/TheTesting.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:02.47
root@Jdotnet6-112:~/TheTesting# bin/Debug/net6.0/TheTesting
Hello, World!
root@Jdotnet6-112:~/TheTesting# cat <<EOF >Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Google.Apis;
namespace TestProject
{
class Program
{
static void Main(string[] args)
{ Stack<int> myStack = new Stack<int>();
var th = new Thread(()=>WaitAndPrint(myStack)); th.Start(); Console.WriteLine("Me first!"); myStack.Push(1); Console.WriteLine("Finished tasks: {0}", myStack.Count); Thread.Sleep(1000); Console.WriteLine("Finished tasks: {0}", myStack.Count);
}
root@Jdotnet6-112:~/TheTesting# dotnet run
Me first!
Finished tasks: 1
Me second!
Finished tasks: 2
root@Jdotnet6-112:~/TheTesting#
root@Jdotnet6-112:~/TheTesting# dotnet remove TheTesting.csproj package Google.Apis
info : Removing PackageReference for package 'Google.Apis' from project 'TheTesting.csproj'.
root@Jdotnet6-112:~/TheTesting# dotnet run
/root/TheTesting/Program.cs(6,17): error CS0246: The type or namespace name 'Google' could not be found (are you missing a using directive or an assembly reference?) [/root/TheTesting/TheTesting.csproj]
The build failed. Fix the build errors and run again.
Verification on Jammy: OK
#0.Check installation:
root@Jdotnet6- 112:~# dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.112
Commit: d311a58ee1
Runtime Environment: dotnet/ sdk/6.0. 112/
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/
global.json file:
Not found
Host:
Version: 6.0.12
Architecture: x64
Commit: 02e45a41b7
.NET SDKs installed: dotnet/ sdk]
6.0.112 [/usr/lib/
.NET runtimes installed: AspNetCore. App 6.0.12 [/usr/lib/ dotnet/ shared/ Microsoft. AspNetCore. App] NETCore. App 6.0.12 [/usr/lib/ dotnet/ shared/ Microsoft. NETCore. App]
Microsoft.
Microsoft.
Download .NET: /aka.ms/ dotnet- download
https:/
Learn about .NET Runtimes and SDKs: /aka.ms/ dotnet/ runtimes- sdk-info 112:~# dotnet --version 112:~# dotnet sdk check
https:/
root@Jdotnet6-
6.0.112
root@Jdotnet6-
Welcome to .NET 6.0! ------- -------
-------
SDK Version: 6.0.112
---------------- /aka.ms/ dotnet- https /aka.ms/ dotnet- hello-world /aka.ms/ dotnet- whats-new /aka.ms/ dotnet- docs /github. com/dotnet/ core /aka.ms/ dotnet- cli ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -- ------- ------- ---
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:/
----------------
Write your first app: https:/
Find out what's new: https:/
Explore documentation: https:/
Report issues and find source on GitHub: https:/
Use 'dotnet --help' to see available commands or visit: https:/
-------
.NET SDKs:
Version Status
-------
6.0.112 Up to date.
Try out the newest .NET SDK features with .NET 7.0.101.
.NET Runtimes: ------- ------- ------- ------- ------- ------- ----- AspNetCore. App 6.0.12 Up to date. NETCore. App 6.0.12 Up to date.
Name Version Status
-------
Microsoft.
Microsoft.
The latest versions of .NET can be installed from https:/ /aka.ms/ dotnet- core-download. For more information about .NET lifecycles, see https:/ /aka.ms/ dotnet- core-support.
root@Jdotnet6- 112:~#
#2. Checking console, solution and project commands:
root@Jdotnet6- 112:~# dotnet new console --name TheTesting
The template "Console App" was created successfully.
Processing post-creation actions... g/TheTesting. csproj. .. g/TheTesting. csproj (in 92 ms).
Running 'dotnet restore' on /root/TheTestin
Determining projects to restore...
Restored /root/TheTestin
Restore succeeded.
root@Jdotnet6- 112:~# cd TheTesting/ 112:~/TheTestin g# dotnet new sln 112:~/TheTestin g# dotnet sln TheTesting.sln add TheTesting.csproj 112:~/TheTestin g# dotnet build TheTesting.sln
root@Jdotnet6-
The template "Solution File" was created successfully.
root@Jdotnet6-
Project `TheTesting.csproj` added to the solution.
root@Jdotnet6-
Microsoft (R) Build Engine version 17.0.1+b177f8fa7 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore... g/bin/Debug/ net6.0/ TheTesting. dll
All projects are up-to-date for restore.
TheTesting -> /root/TheTestin
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:02.47 112:~/TheTestin g# bin/Debug/ net6.0/ TheTesting
root@Jdotnet6-
Hello, World!
root@Jdotnet6- 112:~/TheTestin g# cat <<EOF >Program.cs Collections. Generic; Threading. Tasks;
using System;
using System.
using System.Linq;
using System.Text;
using System.
using Google.Apis;
namespace TestProject
Stack< int> myStack = new Stack<int>(); ()=>WaitAndPrin t(myStack) );
th.Start( );
Console. WriteLine( "Me first!");
myStack. Push(1) ;
Console. WriteLine( "Finished tasks: {0}", myStack.Count);
Thread. Sleep(1000) ;
Console. WriteLine( "Finished tasks: {0}", myStack.Count);
{
class Program
{
static void Main(string[] args)
{
var th = new Thread(
}
private static void WaitAndPrint( Stack<int> myStack){
Thread. Sleep(1000) ;
Console. WriteLine( "Me second!");
myStack. Push(2) ;
}
}
}
EOF
root@Jdotnet6- 112:~/TheTestin g# dotnet add TheTesting.csproj package Google.Apis csproj' . /api.nuget. org/v3/ registration5- gz-semver2/ google. apis/index. json /api.nuget. org/v3/ registration5- gz-semver2/ google. apis/index. json 913ms g/TheTesting. csproj. .. /api.nuget. org/v3- flatcontainer/ google. apis/index. json /api.nuget. org/v3- flatcontainer/ google. apis/index. json 605ms /api.nuget. org/v3- flatcontainer/ google. apis/1. 58.0/google. apis.1. 58.0.nupkg /api.nuget. org/v3- flatcontainer/ google. apis/1. 58.0/google. apis.1. 58.0.nupkg 21ms /api.nuget. org/v3- flatcontainer/ google. apis.core/ index.json /api.nuget. org/v3- flatcontainer/ google. apis.core/ index.json 558ms /api.nuget. org/v3- flatcontainer/ google. apis.core/ 1.58.0/ google. apis.core. 1.58.0. nupkg /api.nuget. org/v3- flatcontainer/ google. apis.core/ 1.58.0/ google. apis.core. 1.58.0. nupkg 19ms /api.nuget. org/v3- flatcontainer/ newtonsoft. json/index. json /api.nuget. org/v3- flatcontainer/ newtonsoft. json/index. json 675ms /api.nuget. org/v3- flatcontainer/ newtonsoft. json/13. 0.2/newtonsoft. json.13. 0.2.nupkg /api.nuget. org/v3- flatcontainer/ newtonsoft. json/13. 0.2/newtonsoft. json.13. 0.2.nupkg 26ms /api.nuget. org/v3/ index.json with content hash e1QpJz6hMuxN7Wh m9ORl98dV9/ 6kM4UC+ zNHGFO/ S7OVV4wglFkix9D MidzdEmo3AGrs9K ZSk69N+ rYHJKqn+ A==. /api.nuget. org/v3/ index.json with content hash OFIWLMbxL096T6L 3b0cQLSQGAxRZWI ZLNkjZtaYUQ5exz 67aW7+Sd+ OQnzdFGrV0yyTNl MOy+j6AqmdsenJH XA==. /api.nuget. org/v3/ index.json with content hash R2pZ3B0UjeyHShm 9vG+Tu0EBb2lC8b 0dFzV9gVn50ofHX h9Smjk6kTn7A/ FdAsC8B5cKib1On GYOXxRBz5XQDg= =. csproj' . TheTesting/ TheTesting. csproj' . g/obj/project. assets. json g/TheTesting. csproj (in 2.36 sec). 112:~/TheTestin g#
Determining projects to restore...
Writing /tmp/tmphkb3nK.tmp
info : Adding PackageReference for package 'Google.Apis' into project 'TheTesting.
info : GET https:/
info : OK https:/
info : Restoring packages for /root/TheTestin
info : GET https:/
info : OK https:/
info : GET https:/
info : OK https:/
info : GET https:/
info : OK https:/
info : GET https:/
info : OK https:/
info : GET https:/
info : OK https:/
info : GET https:/
info : OK https:/
info : Installed Google.Apis.Core 1.58.0 from https:/
info : Installed Google.Apis 1.58.0 from https:/
info : Installed Newtonsoft.Json 13.0.2 from https:/
info : Package 'Google.Apis' is compatible with all the specified frameworks in project 'TheTesting.
info : PackageReference for package 'Google.Apis' version '1.58.0' added to file '/root/
info : Committing restore...
info : Writing assets file to disk. Path: /root/TheTestin
log : Restored /root/TheTestin
root@Jdotnet6-
root@Jdotnet6- 112:~/TheTestin g# dotnet run 112:~/TheTestin g#
Me first!
Finished tasks: 1
Me second!
Finished tasks: 2
root@Jdotnet6-
root@Jdotnet6- 112:~/TheTestin g# dotnet remove TheTesting.csproj package Google.Apis csproj' . 112:~/TheTestin g# dotnet run g/Program. cs(6,17) : error CS0246: The type or namespace name 'Google' could not be found (are you missing a using directive or an assembly reference?) [/root/ TheTesting/ TheTesting. csproj]
info : Removing PackageReference for package 'Google.Apis' from project 'TheTesting.
root@Jdotnet6-
/root/TheTestin
The build failed. Fix the build errors and run again.