1
using Newtonsoft.Json;

namespace XX.XX.XX.XX
{
 public class Geolocation
 {
    [JsonProperty(PropertyName = "postal_code")]
    public string PostalCode { get; set; }

    [JsonProperty(PropertyName = "status")]
    public string Status { get; set; }
    [JsonProperty(PropertyName = "message")]
    public string Message { get; set; }
 }
}

I was facing below build error for the above code

Severity Code Description Project File Line Suppression State Error CS0433 The type 'JsonPropertyAttribute' exists in both 'NestV5, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Newtonsoft.Json, Version=7.0.0.0,

Noman Chali
  • 330
  • 3
  • 15

1 Answers1

0

go solution explorer -> project -> references -> NestV5 right-click properties and change aliases from global to NestV5 like below

enter image description here

Noman Chali
  • 330
  • 3
  • 15