Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in dotnet try command ( red area when executing code ) #938

Open
5 of 13 tasks
abdou31 opened this issue May 15, 2021 · 18 comments
Open
5 of 13 tasks

Bug in dotnet try command ( red area when executing code ) #938

abdou31 opened this issue May 15, 2021 · 18 comments
Labels

Comments

@abdou31
Copy link

abdou31 commented May 15, 2021

Describe the bug

I'm trying to execute dotnet try to try code samples of this repo but when I'm try run the code, I got this red area without any message.

What can I do in this case????

I really need help to fix this problem because I'm following a Linkedin course that use this tool .

dotnet --version
5.0.203

dotnet --list-sdks
2.1.524 [C:\Program Files\dotnet\sdk]
2.1.700-preview-009618 [C:\Program Files\dotnet\sdk]
3.1.200 [C:\Program Files\dotnet\sdk]
3.1.409 [C:\Program Files\dotnet\sdk]
5.0.203 [C:\Program Files\dotnet\sdk]

dotnet --info
SDK .NET (reflétant tous les fichiers global.json) :
Version: 5.0.203
Commit: 38xxxx
Environnement d'exécution :
OS Name: Windows
OS Version: 10.0
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.203\

Host (useful for support):
Version: 5.0.6
Commit: 478b2f8c0e

.NET SDKs installed:
2.1.524 [C:\Program Files\dotnet\sdk]
2.1.700-preview-009618 [C:\Program Files\dotnet\sdk]
3.1.200 [C:\Program Files\dotnet\sdk]
3.1.409 [C:\Program Files\dotnet\sdk]
5.0.203 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Did this error occur while using dotnet try or online?

  • dotnet-try
  • online

What kind of error was it?

  • User Interface (UI): For example the output never displayed
  • Service Error: For example "The service is temporarily unavailable. We are working on it"
  • Other:

Screenshots

image

Please complete the following:

  • OS
    • Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser
    • Chrome
    • Edge
    • Safari

Update:
I saw that the problem come from Kaspersky Antivirus, so when I disable the antivirus, the error is gone.
But this is not a good solution , I would like to know how can I add an except for the localhost??

@Flash0ver
Copy link

Flash0ver commented Jun 8, 2021

I have this issue now as well, where the network tab of my browser says:

{
"exception": "System.AggregateException: One or more errors occurred. (Unsupported log file format. Latest supported version is 9, the log file has version 13.)" ...,
"message": "An unhandled exception occurred."
}

Also, dotnet try verify fails to verify my project:

...
Unhandled exception: System.AggregateException: One or more errors occurred. (Unsupported log file format. Latest supported version is 9, the log file has version 13.)
 ---> System.NotSupportedException: Unsupported log file format. Latest supported version is 9, the log file has version 13.
   at ...

And, I have a déjà vu:
I believe I have experienced this error roughly a year ago with "latest supported version 7, but log file has version 9" or similar.

It seems that it worked fine with the .NET Core SDK 3.1.409, but then broke for me after installing the .NET Core SDK 3.1.410.
And now it does not work anymore since I have the Microsoft.NETCore.App 3.1.16 runtime installed on my machine.
It still works fine on a different machine, where I still have the Microsoft.NETCore.App 3.1.15 runtime installed.

Repo project: https://github.com/Flash0ver/F0-Talks-MutationTesting/tree/main/presentation

@jonsequitur
Copy link
Contributor

Yup, this looks like it's due to a change in the log format for MSBuild. We'll look into whether we can support multiple versions and/or roll forward to .NET 5.

@mezJihad
Copy link

mezJihad commented Oct 5, 2021

I have same probleme, if any one can help please

@ssedlak
Copy link

ssedlak commented Jan 19, 2022

I can't tell if I am missing something or something is wrong that I can't fix. Uncaught (in promise) Error

Untitled1
Untitled

@MaartenGDev
Copy link

MaartenGDev commented Jan 27, 2022

global.json can be used to fix the log version error.

I used the following steps to fix the "Unsupported log format error":

  1. Install preview version of dotnet try (source: https://github.com/dotnet/try/blob/main/DotNetTryLocal.md)
dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-try
  1. Clone sample repo
git clone https://github.com/dotnet/try-samples.git
cd try-samples
  1. Create global.json inside the try-samples folder
touch global.json
  1. Place the following contents in global.json in the try-samples folder. Use the latest .NET 3.1 that you have installed (dotnet --list-sdks)
{
  "sdk": {
    "version": "3.1.416"
  }
}
  1. Run dotnet try in the try-samples folder:
dotnet try

The internal server errors should be fixed. Run dotnet try verify if any other error occurs.

@ssedlak
Copy link

ssedlak commented Jan 30, 2022

@MaartenGDev
I did everything except I was not able to clone the repo. I tried to just add the json into my existing directory, but still a red box.
image

@MaartenGDev
Copy link

MaartenGDev commented Jan 30, 2022

@ssedlak2278 This error happens if you do not have a SSH key configured in your GitHub profile. You can try cloning using:

git clone https://github.com/dotnet/try-samples.git

You need to follow the steps in #938 (comment) again after cloning the repository.

@ssedlak
Copy link

ssedlak commented Jan 30, 2022

@MaartenGDev It worked! Thank you.
I did have to restart my brower before it worked, probably because I've had it open a week.

@Hultner
Copy link

Hultner commented Feb 9, 2022

global.json can be used to fix the log version error.

I used the following steps to fix the "Unsupported log format error":

  1. Install preview version of dotnet try (source: https://github.com/dotnet/try/blob/main/DotNetTryLocal.md)
dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-try
  1. Clone sample repo
git clone https://github.com/dotnet/try-samples.git
cd try-samples
  1. Create global.json inside the try-samples folder
touch global.json
  1. Place the following contents in global.json in the try-samples folder. Use the latest .NET 3.1 that you have installed (dotnet --list-sdks)
{
  "sdk": {
    "version": "3.1.416"
  }
}
  1. Run dotnet try in the try-samples folder:
dotnet try

The internal server errors should be fixed. Run dotnet try verify if any other error occurs.

Doesn't help for me, tried in multiple browsers as well. Verify outputs a bunch of errors for me as well.

It would be neat if there were a docker-image with a known working configuration so one could pull and run that image and just run the samples without worrying about problems in local environments.

I run MacOS and have tried in Chrome as well as Safari.

@MaartenGDev
Copy link

@Hultner which version of .NET 3.1 do you have installed? Can be checked using dotnet --list-sdks?

@Hultner
Copy link

Hultner commented Feb 9, 2022

@Hultner which version of .NET 3.1 do you have installed? Can be checked using dotnet --list-sdks?

$ dotnet --list-sdks
2.2.105 [/usr/local/share/dotnet/sdk]
2.2.204 [/usr/local/share/dotnet/sdk]
3.0.100 [/usr/local/share/dotnet/sdk]
3.1.416 [/usr/local/share/dotnet/sdk]
6.0.101 [/usr/local/share/dotnet/sdk]

Looks like 3.1.416, which I also added to the global.json file according to your instructions.

@cherepo
Copy link

cherepo commented Mar 8, 2022

Same error on a Mac (not M1)

2.2.207 [/usr/local/share/dotnet/sdk]
3.1.413 [/usr/local/share/dotnet/sdk]
3.1.416 [/usr/local/share/dotnet/sdk]
5.0.202 [/usr/local/share/dotnet/sdk]
5.0.401 [/usr/local/share/dotnet/sdk]
5.0.405 [/usr/local/share/dotnet/sdk]
6.0.200 [/usr/local/share/dotnet/sdk]

@jeremy7710
Copy link

jeremy7710 commented Mar 21, 2022

global.json can be used to fix the log version error.

I used the following steps to fix the "Unsupported log format error":

  1. Install preview version of dotnet try (source: https://github.com/dotnet/try/blob/main/DotNetTryLocal.md)
dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-try
  1. Clone sample repo
git clone https://github.com/dotnet/try-samples.git
cd try-samples
  1. Create global.json inside the try-samples folder
touch global.json
  1. Place the following contents in global.json in the try-samples folder. Use the latest .NET 3.1 that you have installed (dotnet --list-sdks)
{
  "sdk": {
    "version": "3.1.416"
  }
}
  1. Run dotnet try in the try-samples folder:
dotnet try

The internal server errors should be fixed. Run dotnet try verify if any other error occurs.

This works for me, Thanks.
I'm on a win10.

@vasveone
Copy link

Just added the global.json as advised from @MaartenGDev in my project folder and works fine!

{
  "sdk": {
    "version": "3.1.416"
  }
}

@yimaiyan
Copy link

same error in macOS(not M1), as advised from @MaartenGDev in my project folder but failed to fix this issue.
Can anyone help? Thanks!

@thanh-tran-tien
Copy link

global.json can be used to fix the log version error.

I used the following steps to fix the "Unsupported log format error":

  1. Install preview version of dotnet try (source: https://github.com/dotnet/try/blob/main/DotNetTryLocal.md)
dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-try
  1. Clone sample repo
git clone https://github.com/dotnet/try-samples.git
cd try-samples
  1. Create global.json inside the try-samples folder
touch global.json
  1. Place the following contents in global.json in the try-samples folder. Use the latest .NET 3.1 that you have installed (dotnet --list-sdks)
{
  "sdk": {
    "version": "3.1.416"
  }
}
  1. Run dotnet try in the try-samples folder:
dotnet try

The internal server errors should be fixed. Run dotnet try verify if any other error occurs.

BIG LOVE! BRO

@cheema-corellian
Copy link

cheema-corellian commented Oct 17, 2023

I followed the instructions in this comment

At first it did not fix my problem. dotnet try verify did not run successfully. The browser still showed red. I then restarted my browser, and the red box in the browser went away. Success!

Here is what my global.json looks like:

{
  "sdk": {
    "version": "7.0.402"
  }
}

For me, it is OK to ignore the dotnet try verify errors, for now.

@Godaday
Copy link

Godaday commented Jul 26, 2024

This is the process I followed to resolve the error, for your reference.

mkdir mydoc

cd mydoc

dotnet new console -n myApp -f netcoreapp3.1
cd myApp 

create a new file "global.json"

{
  "sdk": {
    "version": "3.1.416"
  }
}

in file version node content look your local sdk list

dotnet --list-sdks
 cd mydoc

create file doc.md

# My Interactive Document:

```cs --source-file ./myApp/Program.cs --project ./myApp/myApp.csproj
```
dotnet try verify
dotnet try

image

it's worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests