Open edmondtchoua opened 2 years ago
I have the same issue. Did you figure out the solution? Thanks.
I was able to get this working with the SDK 3.1.424 installed alongside of 6.0.402. Had to add a global.json at the root of try-samples like this
{ "sdk": { "version": "3.1.424" } }
Removed references to the package 'System.CommandLine.Experimental' from all of the .csproj files.
Removed the same references in .\try-samples\101-linq-samples\src\obj\project.assets.json
Be sure to update any references to the latest SDK to refer to the 3.1.424, ie: in the project.assets.json...
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.424\\RuntimeIdentifierGraph.json"
The first run will give an error but subsequent runs ran without issue.
I was able to get this working with the SDK 3.1.424 installed alongside of 6.0.402. Had to add a global.json at the root of try-samples like this
{ "sdk": { "version": "3.1.424" } }
Removed references to the package 'System.CommandLine.Experimental' from all of the .csproj files. Removed the same references in .\try-samples\101-linq-samples\src\obj\project.assets.json Be sure to update any references to the latest SDK to refer to the 3.1.424, ie: in the project.assets.json...
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.424\\RuntimeIdentifierGraph.json"
The first run will give an error but subsequent runs ran without issue.
Hey man, if you managed to solve the issue, is there a way you could upload the working file somewhere? I'd do the modifications myself, but I only really now some C# and SQL, I found this repository through a tutorial but I can't make it work, so I was just wondering if you could help since you've already found a solution.
I was able to get this working with the SDK 3.1.424 installed alongside of 6.0.402. Had to add a global.json at the root of try-samples like this
{ "sdk": { "version": "3.1.424" } }
Removed references to the package 'System.CommandLine.Experimental' from all of the .csproj files. Removed the same references in .\try-samples\101-linq-samples\src\obj\project.assets.json Be sure to update any references to the latest SDK to refer to the 3.1.424, ie: in the project.assets.json..."runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.424\\RuntimeIdentifierGraph.json"
The first run will give an error but subsequent runs ran without issue.Hey man, if you managed to solve the issue, is there a way you could upload the working file somewhere? I'd do the modifications myself, but I only really now some C# and SQL, I found this repository through a tutorial but I can't make it work, so I was just wondering if you could help since you've already found a solution.
Hey TallGuy,
The version of .NET SDK you have installed is important. I forked the original dotnet/try-samples repo to here and made the changes for you. For this to work, you still will need to download the latest version of the .Net 3.1.426 SDK located here, afterward, if you haven't done so already, install the dotnet-try tool (same instructions on the README as before). Then when you git clone
the repo, you should be able to start a console session in the folder you save it to and run dotnet try
. It will open your browser as before but should give you sample output this time.
Thanks man, really appreciate it. Cheers!
I met the similar thing in my Computer too, the issue is solved with below steps:
The enviornment:
OS: Win 11
.NET SDKs: .NET Core 3.0 SDK, .NET Core 3.1 SDK, .NET 6.0 SDK, .NET 8.0 SDK installed.
If you install it with the command "dotnet tool install -g dotnet-try", you need unistall it first with:
dotnet tool uninstall -g dotnet-try
If you install it with the command "dotnet tool install -g Microsoft.dotnet-try", you need unistall it first with:
dotnet tool uninstall -g Microsoft.dotnet-try
Then install the latest verion of "dotnet try" with below command:
dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-try
In Windows, recommand to run above commands in "cmd" with admin permission.
You can run below command to check:
dotnet --list-sdks
If you did not install them, download from below links and install them.
https://dotnet.microsoft.com/en-us/download/dotnet/3.0 https://dotnet.microsoft.com/en-us/download/dotnet/3.1
Note: .NET core 3.1 SDK's version is "3.1.416" so far.
git clone https://github.com/dotnet/try-samples
The content is below:
{
"sdk": {
"version": "3.1.416"
}
}
Note: the version "3.1.416" here should be the same as in step 2.
cd try-samples/
dotnet try verify
If no exceptions happened, jump to next step below. Else try to remove references to the package 'System.CommandLine.Experimental' from all of the .csproj files.
dotnet try ".\101-linq-samples"
May it be helpful for you.
References:
https://github.com/dotnet/try/blob/main/DotNetTryLocal.md
https://github.com/dotnet/try/issues/938#issuecomment-1023604536
This anwer first published in: https://stackoverflow.com/a/78534041/6075331
This code does not execute normally, I get a red stripe every time I try![image](https://user-images.githubusercontent.com/13337497/177003185-202963d3-ccc6-4f87-97cc-a0737b1a08be.png)