The selected file cannot be opened as a solution or project. Please select a solution file or a project file

31 Views Asked by At

I am a manual tester, but started my journey to learn Playwright with C#.net, I installed Visual Studio community edition and .NET 8.0 SDK and set the Environment variable as mentioned in the few articles here, but when I try to open this project to the visual studio, then get the error: The selected file cannot be opened as a solution or project. Please select a solution file or a project file.

where.exe dotnet shows path as C:\Program Files\dotnet\dotnet.exe

dotnet --info
.NET SDK:
 Version:           8.0.202
 Commit:            25674bb2f4
 Workload version:  8.0.200-manifests.4e94be9c

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.202\

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.3
  Architecture: x64
  Commit:       9f4b1f5d66

.NET SDKs installed:
  8.0.202 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
PS C:\Users\hsmeh>

I created the project using command: dotnet new nunit -n PlayWrightPracticeProject and when tried to open this project then get the error

1

There are 1 best solutions below

0
Gaurav Khurana On

Follow the steps as mentioned in this page on official playwright site

Step 1 to 4 will help you running the first program even without opening any IDE and building your code.

Once that works open the solution file/folder from the IDE rather than opening the file by clicking on it.