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:
$ dotnet new console --name TheTesting
The template "Console App" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on /home/ubuntu/TheTesting/TheTesting.csproj...
Determining projects to restore...
Restored /home/ubuntu/TheTesting/TheTesting.csproj (in 72 ms).
Restore succeeded.
$ cd TheTesting/
$ dotnet new sln
The template "Solution File" was created successfully.
$ dotnet sln TheTesting.sln add TheTesting.csproj
Project `TheTesting.csproj` added to the solution.
$ 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 -> /home/ubuntu/TheTesting/bin/Debug/net6.0/TheTesting.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.97
$ bin/Debug/net6.0/TheTesting
Hello, World!
$ 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);
}
$ dotnet run
Me first!
Finished tasks: 1
Me second!
Finished tasks: 2
$ dotnet remove TheTesting.csproj package Google.Apis
info : Removing PackageReference for package 'Google.Apis' from project 'TheTesting.csproj'.
$ dotnet run
/home/ubuntu/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?) [/home/ubuntu/TheTesting/TheTesting.csproj]
The build failed. Fix the build errors and run again.
#1. Basic check commands:
$ 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.10
OS Platform: Linux
RID: ubuntu.22.10-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
https:/
$ dotnet --version
6.0.112
$ dotnet sdk check
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.
#2. Checking console, solution and project commands:
$ dotnet new console --name TheTesting
The template "Console App" was created successfully.
Processing post-creation actions... TheTesting/ TheTesting. csproj. .. TheTesting/ TheTesting. csproj (in 72 ms).
Running 'dotnet restore' on /home/ubuntu/
Determining projects to restore...
Restored /home/ubuntu/
Restore succeeded.
$ cd TheTesting/
$ dotnet new sln
The template "Solution File" was created successfully.
$ dotnet sln TheTesting.sln add TheTesting.csproj
Project `TheTesting.csproj` added to the solution.
$ 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... TheTesting/ bin/Debug/ net6.0/ TheTesting. dll
All projects are up-to-date for restore.
TheTesting -> /home/ubuntu/
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.97
$ bin/Debug/ net6.0/ TheTesting
Hello, World!
$ 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
$ 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 1301ms TheTesting/ TheTesting. csproj. .. /api.nuget. org/v3- flatcontainer/ google. apis/index. json /api.nuget. org/v3- flatcontainer/ google. apis/index. json 1082ms /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 23ms /api.nuget. org/v3- flatcontainer/ google. apis.core/ index.json /api.nuget. org/v3- flatcontainer/ google. apis.core/ index.json 1082ms /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 24ms /api.nuget. org/v3- flatcontainer/ newtonsoft. json/index. json /api.nuget. org/v3- flatcontainer/ newtonsoft. json/index. json 1096ms /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 20ms /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= =. /api.nuget. org/v3/ index.json with content hash e1QpJz6hMuxN7Wh m9ORl98dV9/ 6kM4UC+ zNHGFO/ S7OVV4wglFkix9D MidzdEmo3AGrs9K ZSk69N+ rYHJKqn+ A==. csproj' . ubuntu/ TheTesting/ TheTesting. csproj' . TheTesting/ obj/project. assets. json TheTesting/ TheTesting. csproj (in 4.67 sec).
Determining projects to restore...
Writing /tmp/tmpLcv5iU.tmp
info : Adding PackageReference for package 'Google.Apis' into project 'TheTesting.
info : GET https:/
info : OK https:/
info : Restoring packages for /home/ubuntu/
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 1.58.0 from https:/
info : Installed Newtonsoft.Json 13.0.2 from https:/
info : Installed Google.Apis.Core 1.58.0 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 '/home/
info : Committing restore...
info : Writing assets file to disk. Path: /home/ubuntu/
log : Restored /home/ubuntu/
$ dotnet run
Me first!
Finished tasks: 1
Me second!
Finished tasks: 2
$ dotnet remove TheTesting.csproj package Google.Apis csproj' .
info : Removing PackageReference for package 'Google.Apis' from project 'TheTesting.
$ dotnet run 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?) [/home/ ubuntu/ TheTesting/ TheTesting. csproj]
/home/ubuntu/
The build failed. Fix the build errors and run again.