Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SvcUtil /edb doesn't generate INotifyPropertyChange when DotNET 4.5 is installed

All of the dev computers here but one has DotNET 4.5 installed. The last one has 4.0 installed. Only the one with 4.0 generates proxy classes that implements INotifyPropertyChange, all other computers doesn't.

According to MSDN /edb is supported. http://msdn.microsoft.com/en-us/library/aa347733(v=vs.110).aspx

The switches we are using is: /o /ct /r / edb / n /noconfig /tcv

This is generated from the 4.0 computer:

public partial class OrganizationEdition : MyCompany.MyProject.Client.Win.ServiceProxy.UpdateableEntity, System.ComponentModel.INotifyPropertyChanged
{

    private string CommentField;

    private System.DateTime ValidFromField;

    private System.Nullable<System.DateTime> ValidToField;

    [System.Runtime.Serialization.DataMemberAttribute()]
    public string Comment
    {
        get
        {
            return this.CommentField;
        }
        set
        {
            if ((object.Equals(this.CommentField, value) != true))
            {
                this.CommentField = value;
                this.RaisePropertyChanged("Comment");
            }
        }
    }

This is from a 4.5 computer (with Windows SDK 7.0A):

public partial class OrganizationEdition : MyCompany.MyProject.Client.Win.ServiceProxy.UpdateableEntity
{

    private string CommentField;

    private System.DateTime ValidFromField;

    private System.Nullable<System.DateTime> ValidToField;

    [System.Runtime.Serialization.DataMemberAttribute()]
    public string Comment
    {
        get
        {
            return this.CommentField;
        }
        set
        {
            this.CommentField = value;
        }
    }
like image 710
Carl R Avatar asked Nov 14 '13 15:11

Carl R


1 Answers

I can't tell you why it is not working.

However I could give you a trick how to get around this. You could use .tt files (T4 templates) in order to restore missing notifications in property setters in particular classes existing in your solution at compile time.

An example of how to implement such functionality is avaliable here on Pluralsight and here on MSDN is more information about T4 templates syntax.

like image 191
Ryszard Dżegan Avatar answered Nov 14 '22 23:11

Ryszard Dżegan