try icon indicating copy to clipboard operation
try copied to clipboard

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

Open abdou31 opened this issue 3 years ago • 18 comments

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?

  • [x] dotnet-try
  • [ ] online

What kind of error was it?

  • [x] 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
    • [x] Windows 10
    • [ ] macOS
    • [ ] Linux (Please specify distro)
    • [ ] iOS
    • [ ] Android
  • Browser
    • [x] Chrome
    • [x] 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??

abdou31 avatar May 15 '21 03:05 abdou31

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

Flash0ver avatar Jun 08 '21 23:06 Flash0ver

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.

jonsequitur avatar Jun 08 '21 23:06 jonsequitur

I have same probleme, if any one can help please

mezJihad avatar Oct 05 '21 13:10 mezJihad

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

Untitled1 Untitled

ssedlak avatar Jan 19 '22 14:01 ssedlak

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.

MaartenGDev avatar Jan 27 '22 20:01 MaartenGDev

@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

ssedlak avatar Jan 30 '22 05:01 ssedlak

@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 https://github.com/dotnet/try/issues/938#issuecomment-1023604536 again after cloning the repository.

MaartenGDev avatar Jan 30 '22 13:01 MaartenGDev

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

ssedlak avatar Jan 30 '22 14:01 ssedlak

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.

Hultner avatar Feb 09 '22 10:02 Hultner

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

MaartenGDev avatar Feb 09 '22 11:02 MaartenGDev

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

Hultner avatar Feb 09 '22 12:02 Hultner

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]

cherepo avatar Mar 08 '22 23:03 cherepo

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.

jeremy7710 avatar Mar 21 '22 05:03 jeremy7710

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

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

vasveone avatar Apr 16 '22 05:04 vasveone

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

yimaiyan avatar May 26 '22 02:05 yimaiyan

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

thanh-tran-tien avatar Aug 03 '22 09:08 thanh-tran-tien

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.

cheema-corellian avatar Oct 17 '23 03:10 cheema-corellian