Overrides problem (slightly OT)

Overrides problem (slightly OT)

Old forum URL: forums.lhotka.net/forums/t/585.aspx


matt tag posted on Tuesday, July 11, 2006

Strange occurance indeed - I opened my project this morning, and 3 of my ActiveObjects "OnNotification" overrides had the following error.

sub 'OnNotification' cannot be declared 'Overrides' because it does not override a sub in a base class.    C:\Develop\dotNet\Charter\Charter.Library\GameSetup\Game.vb

Ok, I'll play your silly game - I removed the 'Overrides', and then I get this warning:

sub 'OnNotification' shadows an overridable method in the base class 'ActiveBusinessBase'. To override the base method, this method must be declared 'Overrides'.   

Make up your mind!

If I change the 'overrides' to 'overloads', the error and warning goes away. This is clearly wrong, though. I can even comment out the OnNotification sub, start creating a new one w/ Intellisense, and this new one gives the same "cannot be declare overrides" error.

Any ideas?  I've tried rebuilding CSLA and ActiveObjects, with no success.

matt tag



miroslav replied on Tuesday, July 11, 2006

matt,

I'm not very familiar with ActiveObjects, but this error usualy happens when some arguments of your overriden method are not the same type as the arguments of the base method (or cannot be converted to the base method argument types).

Miroslav

jwooley replied on Tuesday, July 11, 2006

I typically have found this issue when the IDE is using the wrong version of a DLL. This can be particularly tricky if you are using reference paths as tracking down which DLL the IDE is trying to use can be a chore. I recommend doing a Clean on your project. Alternatively, you can try deleting all files from the bin directory and rebuilding. Sometimes, a good old-fashioned reboot does the trick ;-)

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx

ajj3085 replied on Tuesday, July 11, 2006

Along those same lines.. sometimes you can reference an assembly B, which references assembly A.  Your UI assembly C references B and A... but a different version of A than B is using..

Andy

matt tag replied on Tuesday, July 11, 2006

thanks, I fixed the problem by cleaning up the ReferencePaths in my project (they were pointing to all kinds of crazy paths).

matt tag

Copyright (c) Marimer LLC