No idea why when I change this:
using System;
using System.IO;
public static class Constants
{
public static string MainCarFilePath = Path.Combine(Environment.CurrentDirectory, "\\Cars.csv");
}
to this:
using System;
using System.IO;
public static class Constants
{
public const string MainCarFilePath = Path.Combine(Environment.CurrentDirectory, "\\Cars.csv");
}
That now it breaks and it doesn't recognize the Combine method of the Path object (System.IO).
I get can't resolve Combine...
const requires that the value be constant at compile time.
Use public static readonly string, instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With