Home > Net >  Unable to find ISOWeek
Unable to find ISOWeek

Time:12-15

I'm trying to use ISOWeek but I can't find it anywhere. I've tried a few different ways of using it:

var a = System.Globalization.ISOWeek.GetWeekOfYear(DateTime.Now);
var b = ISOWeek.GetWeekOfYear(DateTime.Now);
var c = new ISOWeek();

I've tried adding every System.Runtime reference I could find, but it's always giving these errors:

error CS0234: The type or namespace name 'ISOWeek' does not exist in the namespace 'System.Globalization' (are you missing an assembly reference?)

error CS0103: The name 'ISOWeek' does not exist in the current context

error CS0246: The type or namespace name 'ISOWeek' could not be found (are you missing a using directive or an assembly reference?)

I'm using .Net Framework 4.7.1

How can I get access to ISOWeek?

CodePudding user response:

ISOWeek is not in .NET Framework. It is only available in .NET Core 3 , and .NET 5 .

  • Related