Comment 6 for bug 1999549

Revision history for this message
Graham Inggs (ginggs) wrote :

#1. Basic check commands:

$ dotnet --info
.NET SDK (reflecting any global.json):
 Version: 6.0.112
 Commit: d311a58ee1

Runtime Environment:
 OS Name: ubuntu
 OS Version: 22.10
 OS Platform: Linux
 RID: ubuntu.22.10-x64
 Base Path: /usr/lib/dotnet/sdk/6.0.112/

global.json file:
  Not found

Host:
  Version: 6.0.12
  Architecture: x64
  Commit: 02e45a41b7

.NET SDKs installed:
  6.0.112 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.12 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.12 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

$ dotnet --version
6.0.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.

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...
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);
          }

          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
  Determining projects to restore...
  Writing /tmp/tmpLcv5iU.tmp
info : Adding PackageReference for package 'Google.Apis' into project 'TheTesting.csproj'.
info : GET https://api.nuget.org/v3/registration5-gz-semver2/google.apis/index.json
info : OK https://api.nuget.org/v3/registration5-gz-semver2/google.apis/index.json 1301ms
info : Restoring packages for /home/ubuntu/TheTesting/TheTesting.csproj...
info : GET https://api.nuget.org/v3-flatcontainer/google.apis/index.json
info : OK https://api.nuget.org/v3-flatcontainer/google.apis/index.json 1082ms
info : GET https://api.nuget.org/v3-flatcontainer/google.apis/1.58.0/google.apis.1.58.0.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/google.apis/1.58.0/google.apis.1.58.0.nupkg 23ms
info : GET https://api.nuget.org/v3-flatcontainer/google.apis.core/index.json
info : OK https://api.nuget.org/v3-flatcontainer/google.apis.core/index.json 1082ms
info : GET https://api.nuget.org/v3-flatcontainer/google.apis.core/1.58.0/google.apis.core.1.58.0.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/google.apis.core/1.58.0/google.apis.core.1.58.0.nupkg 24ms
info : GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json
info : OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json 1096ms
info : GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.2/newtonsoft.json.13.0.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.2/newtonsoft.json.13.0.2.nupkg 20ms
info : Installed Google.Apis 1.58.0 from https://api.nuget.org/v3/index.json with content hash OFIWLMbxL096T6L3b0cQLSQGAxRZWIZLNkjZtaYUQ5exz67aW7+Sd+OQnzdFGrV0yyTNlMOy+j6AqmdsenJHXA==.
info : Installed Newtonsoft.Json 13.0.2 from https://api.nuget.org/v3/index.json with content hash R2pZ3B0UjeyHShm9vG+Tu0EBb2lC8b0dFzV9gVn50ofHXh9Smjk6kTn7A/FdAsC8B5cKib1OnGYOXxRBz5XQDg==.
info : Installed Google.Apis.Core 1.58.0 from https://api.nuget.org/v3/index.json with content hash e1QpJz6hMuxN7Whm9ORl98dV9/6kM4UC+zNHGFO/S7OVV4wglFkix9DMidzdEmo3AGrs9KZSk69N+rYHJKqn+A==.
info : Package 'Google.Apis' is compatible with all the specified frameworks in project 'TheTesting.csproj'.
info : PackageReference for package 'Google.Apis' version '1.58.0' added to file '/home/ubuntu/TheTesting/TheTesting.csproj'.
info : Committing restore...
info : Writing assets file to disk. Path: /home/ubuntu/TheTesting/obj/project.assets.json
log : Restored /home/ubuntu/TheTesting/TheTesting.csproj (in 4.67 sec).

$ 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.