0

I am trying to verify phone number using PhoneNumbers.dll(File version 8.9.0.0) for twillio SMS API with C# (Visual studio 2010)

Lines of Code used in application:

private static PhoneNumberUtil phoneUtil = PhoneNumberUtil.GetInstance();
private static List<string> supportedRegions = phoneUtil.GetSupportedRegions().ToList<string>();

After application build, facing below error

The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

enter image description here

In case same dll used in .Net 2015 no error results with build successed. Please suggest to over come system.object error in .net 2010

TheGeneral
  • 79,002
  • 9
  • 103
  • 141

1 Answers1

0

Im not sure why .net standard is not working for you

however if you really need to you can go to an early version of libphonenumber-csharp

https://www.nuget.org/packages/libphonenumber-csharp/7.7.4

TheGeneral
  • 79,002
  • 9
  • 103
  • 141
  • please share me the link to download net standard 2 supported for visual studio 2010 – Pavankumar Apr 12 '18 at 12:13
  • @Pavankumar the nuget package i linked you to, that particular version 7.7.4 doesn't require .net standard, you don't need it with that version – TheGeneral Apr 12 '18 at 12:16
  • Thank you for the responses and suggestions I have used phonenumbers.dll version 3.7.1.306 and used below link to for my understanding https://stackoverflow.com/questions/31611446/how-to-format-a-phone-numbers-with-libphonenumber-in-international-format var phoneUtil = PhoneNumberUtil.GetInstance(); var numberProto = phoneUtil.Parse("1234567890", "IT"); var formattedPhone = phoneUtil.Format(numberProto, PhoneNumberFormat.INTERNATIONAL); – Pavankumar Apr 18 '18 at 07:21
  • @Pavankumar you shouldn't need to go back to version 3. 7.7.4 seems like it would work, anyway im glad you got it working – TheGeneral Apr 18 '18 at 07:24