0

I'm using Visual Studio 2015 .NET Framework 4.7.2. and I tried to access MinValue from a char but I get an error saying there's no definition.

https://learn.microsoft.com/en-us/dotnet/api/system.char.minvalue?view=netframework-4.7.2

My project has no build errors and I've included using System. How can I correct this error?

enter image description here

usr4896260
  • 1,427
  • 3
  • 27
  • 50
  • Try cleaning and rebuilding your solution. – Sach Oct 03 '19 at 21:32
  • By the way, VS 2015 needs a targeting pack for `.NET 4.7+`. Do you have that? https://stackoverflow.com/questions/43420178/can-i-use-visual-studio-2015-to-target-net-framework-4-7 – Sach Oct 03 '19 at 21:33
  • https://www.microsoft.com/en-us/download/details.aspx?id=56119 – Sach Oct 03 '19 at 21:33
  • I did. I also created a brand new project, starting from scratch. Still have the issue. – usr4896260 Oct 03 '19 at 21:34
  • What does the statement `char minValue = char.MinValue;` followed by `return null;` accomplish? Is this just test code or something? I've never tried using `char.MinValue` before. Does a `Nullable` work for your situation? Not an attempt to answer your question. Just asking if it might be a better solution. – itsme86 Oct 03 '19 at 21:42
  • Do you have `using System;` declared? – David Tansey Oct 03 '19 at 22:37
  • @DavidTansey `System` is not required for `char.MinValue` (plus they specified that it was added in the question). – Rufus L Oct 04 '19 at 01:32

1 Answers1

0

While I previously have installed the developer pack for the .NET 4.7.2, it must have gotten corrupted somehow. I re-downloaded the developer pack and ran a repair, which fixed it.

usr4896260
  • 1,427
  • 3
  • 27
  • 50