I’m facing really strange error while debugging my program. I have a data contract where I added new properties but one of them cause the following exception:
Method not found: 'Void Measurement.set_ContactId(Int32)'.
The data contract looks following:
[DataContract]
public class Measurement
{
[DataMember]
public int FactId { get; set; }
[DataMember]
public int ContactId { get; set; }
.....
I don’t really understand what can be a problem since, as I said, I added some other properties but there was no problem with them.
UPD: The exception is happening on the service side when I try to assign a value to ContactId:
foreach (Measurement m in result.Where(m => m.FactId == factId)){
m.ContactId = contactId;
.....
The problem was with some older version of the DLL which was stored in .NET’s cache. I made a search on the whole disk for the DLL and deleted all found files (some were in use by the .NET so I had to use Unlocker). After rebuilding the project it worked fine.