Visual Studio Contradiction



  •  

    Occurs randomly, usually fixed by turning it off and on again - I guess I'm old fashioned in thinking that compiling code should be a deterministic process.



  • It sounds like a method is trying to implement an interface method, but has the wrong signature. Something like:

    Interface IWhatever
    Sub Frob(foo as integer)
    End Interface

    Class TheClass
    Implements IWhatever

    Sub MyFrob() Implements IWhatever.Frob
    ' ...
    End Sub
    End Class

    Edit: ... Yup, those those are the exact error messages when you compile the above snippet.

    It's worth noting that this error cannot occurr in C#, since it determines interface implemenations based on the name, not on an additional decoration. If you screw up the signature, it'll assume it's a totally separate method.



  • @pkmnfrk said:

    It sounds like a method is trying to implement an interface method, but has the wrong signature.

    Except the signature is fine, and it compiles (and runs) most of the time. Just not on Mondays when there's a full moon.




  • @shiftyphil said:

    Except the signature is fine, and it compiles (and runs) most of the time. Just not on Mondays when there's a full moon.
    I have seen an issue like this before when we had moved from one set of libraries to another. In the change, one of the interfaces changed the signature of one method, so if you compiled with the new libraries you everything was fine but you'd see the errors you're seeing if you compiled with the old libraries.


    Library references are kept in a per-project basis, not a per-solution basis, so what happened to us was that someone had properly configured one project but not the other. So when you compiled the good one you got no error messages, and when you compiled the other one you got these messages, even though the code is exactly the same.



  • @shiftyphil said:

     

    Occurs randomly, usually fixed by turning it off and on again - I guess I'm old fashioned in thinking that compiling code should be a deterministic process.

    Since the image isn't loading, could someone maybe type the error? Thanks.

    If VS is parallelizing compilation, the error could (potentially) depend in somewhat non-deterministic factors. Maybe? I dunno, just guessing.



  • @blakeyrat said:

    Since the image isn't loading, could someone maybe type the error? Thanks.

    Error, Line 221: Class 'MyTask' must implement 'Event PropertyChanged(sender As Object, e as PropertyChangedEventArgs)'

    for interface 'System.ComponentModel.INotifyPropertyChanged'.


    Error, Line 223: 'PropertyChanged' cannot implement 'PropertyChanged' because there is no matching event on interface

    'System.ComponentModel.INotifyPropertyChanged'.



  • @blakeyrat said:

    If VS is parallelizing compilation, the error could (potentially) depend in somewhat non-deterministic factors. Maybe? I dunno, just guessing.

    Most likely it's just running out of memory (or more correctly, address space). Quitting and reoping it works, but Clean All/Rebuild All doesn't.

    Usually manifests itself as a "Not enough storage is available to complete this operation," but sometimes it just goes for random.

     (Code is a 3 form access database frontend that has grown to 200 forms, 400 tables etc).



  • I've seen things like this happen when a debugging session leaves a file locked.  It seems some file access errors fail silently and you end up with a mixture of old and new binaries.


Log in to reply