Trying to open some Windows Forms for the first time since going to X# 2.10 and getting lots of "Duplicate declaration of member '...'" errors.
All seem to relate to custom controls.
Any ideas where to start looking?
Thanks
windows form with custom controls - duplicate declaration of member errors
-
- Posts: 60
- Joined: Tue Oct 11, 2016 8:56 pm
- Location: UK
windows form with custom controls - duplicate declaration of member errors
- Attachments
-
- winformdupdec.jpg (32.78 KiB) Viewed 544 times
windows form with custom controls - duplicate declaration of member errors
Hi Leigh,
I suspect it has to do with this message about Date/DateTime, some control that is using that is some way, although it could also be a red herring.
The most reliable way to debug this is to start removing code from the InitializeComponent() (most likely the culprit) method, until the error is not shown anymore, which will show which was the line of code that caused it. If you'd like I can do this myself (have done it 100s of times so I am very familiar with the procedure) if you can send me a repro sample.
I suspect it has to do with this message about Date/DateTime, some control that is using that is some way, although it could also be a red herring.
The most reliable way to debug this is to start removing code from the InitializeComponent() (most likely the culprit) method, until the error is not shown anymore, which will show which was the line of code that caused it. If you'd like I can do this myself (have done it 100s of times so I am very familiar with the procedure) if you can send me a repro sample.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
windows form with custom controls - duplicate declaration of member errors
Hi Leigh,
Actually I just found this: If there's a line of code in designer.prg like:
SELF:oMyControl:MyDateProperty := (DATE)DateTime.now
then i indeed get the error message about an invalid cast from the form designer and the form doesn't open. I will log this for Robert to fix and it's possible that this is exactly the problem in your form as well, but maybe it's also something different, so we still need to figure this out to be sure.
Actually I just found this: If there's a line of code in designer.prg like:
SELF:oMyControl:MyDateProperty := (DATE)DateTime.now
then i indeed get the error message about an invalid cast from the form designer and the form doesn't open. I will log this for Robert to fix and it's possible that this is exactly the problem in your form as well, but maybe it's also something different, so we still need to figure this out to be sure.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
-
- Posts: 60
- Joined: Tue Oct 11, 2016 8:56 pm
- Location: UK
windows form with custom controls - duplicate declaration of member errors
Hi Chris
I've had issues like this before and even after removing the obvious surplus code from the designer I still have problems this time.
Have emailed you a much simpler example with a single custom control on it.
Leigh
I've had issues like this before and even after removing the obvious surplus code from the designer I still have problems this time.
Have emailed you a much simpler example with a single custom control on it.
Leigh
-
- Posts: 60
- Joined: Tue Oct 11, 2016 8:56 pm
- Location: UK
windows form with custom controls - duplicate declaration of member errors
Just a quick follow-up to say thanks to Chris and Robert for having this issue investigated, diagnosed and patched by Monday morning!
windows form with custom controls - duplicate declaration of member errors
Leigh,
Thanks for the confirmation
Robert
Thanks for the confirmation
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu