Code Playground | Sololearn: Learn to code for FREE!

+1

Code Playground

I'm trying to use the Convert.ToHexString() Method [https://docs.microsoft.com/en-us/dotnet/api/system.convert.tohexstring?view=net-6.0] but I keep getting an error saying 'Convert' doesn't have a ToHexString method?

c#

4/5/2022 10:21:24 PM

Yumi

5 Answers

New Answer

+2

What's your C# compiler version? https://code.sololearn.com/ct3f3Dqv4QCd returns here on Sololearn: C# Compiler Version v4.0.30319 https://stackoverflow.com/questions/247621/what-are-the-correct-version-numbers-for-c/247623#247623 C# 1.0 released with .NET 1.0 C# 1.2 (bizarrely enough); released with .NET 1.1 C# 2.0 released with .NET 2.0 C# 3.0 released with .NET 3.5 C# 4.0 released with .NET 4 <<<<< We're here C# 5.0 released with .NET 4.5 C# 6.0 released with .NET 4.6 C# 7.0 released with .NET 4.6.2 C# 7.3 released with .NET 4.7.2 C# 8.0 released with NET Core 3.0 C# 9.0 released with NET 5.0 << if I understand it correctly toHexString was introduced here C# 10.0 released with NET 6.0 << your link points at this version. https://docs.microsoft.com/en-us/dotnet/api/system.convert.tohexstring?view=net-6.0 The link states under the function's description: "Applies to .NET 7 Preview 1 and other versions Product Versions .NET 5, 6, 7 Preview 1" I guess you're just trying to use a function that isn't implemented in the version used here.

+1

I don't see where you used it in your Hex Test code.

0

Did you use system?

0

William Owens Yes, I got it to work in visual studio. Just not in the code area on here

0

Ahh I didn't even think about checking that