Using IFDEF to comment blocks in Elements 10?

That sounds useful…

Sorry to be dopey but where would I place that?

On closer inspection, it seems to be when I have something like…

type
[Serializable()]
[DataContract()]
TparentClass = public partial class

end;

type
[Serializable()]
[DataContract()]
TchildClass = public partial class(TparentClass)

end;

It is complaining about the double use of the two attributes?

Currently in the project file itself with a text editor (top property group section)

it’s not currently exposed in the IDE.

For:

type
[Serializable()]
[DataContract()]
TparentClass = public partial class
…
end;

type
[Serializable()]
[DataContract()]
TchildClass = public partial class(TparentClass)
…
end;

do you have a more complete example? It’s not showing it for that.

Annoyingly, if I isolate the precise source files out into a new test project, the problem seems to disappear!?! I may try to remove and re-create the problematic project to see if there is some legacy issue hidden within it

I also tried to manually edit UseLegacyPreprocessor into a hierarchy of .elements and .oxygene files that live beneath a single solution (sln) file, but this didn’t seem to make any difference. I’ll try and experiment with a smaller test case

Even with a freshly created empty ASP.NET project, I don’t seem to be able to get UseLegacyPreprocessor to work.

I’ve tried the .elements (including, separately, Debug and Release sections) plus the .user file and none seem to make any difference.

A simple declaration mismatch always gets flagged as an error.

Can you advise?

Is this in aspx.pas files? I don’t think we have that here yet (but I can add that if needed). It should work in plain .pas files (aspx.pas/aspx files pass through the asp.net processor, not the project itself)

Yes it had been a .aspx.pas, but having just switched it to a simple .pas that didn’t work either :o/

Anything you can add that makes it work more broadly would be a help

Whats the specific problem? the IFDEF, or the Attributes?

Definitely not the IFDEF’s they’re long gone from my code.

I had initially had an Attributes issue, which Carlo was unable to re-produce. When I tried to isolate the same it went away here too, which led me to think the original project file may be screwed in some way.

Going back to my main project, I’ve deleted and re-created it and similarly the problem seems to have disappeared, although I’m not quite at the point where I can help you by telling you why.

There has also been a side discussion about getting UseLegacyPreprocessor working, but I have so far been unable to get that to work, even with a minimal test project. Although less critical, this would be nice to have in my armoury to save having to bounce between v9 & v10 installations.

Think I may have spotted the issue. In the project I use some Code Generation *.tt files.

The generated “.pas” output files are usually only seen when the tt file is touched, which I’m wondering may have happened as part of the upgrade?

As these generated files remain linked to the project, you normally see a type duplication of sorts. Given the switch to v10 the precise error message seems to have confused me sufficiently so as not to have recognized them.

UseLegacyPreprocessor only applies to IFDEFs. So if that is sorted out for you, id just forget about that option.

Ah, maybe the .tt-generated files and the .pas files both had th attribute, and that was the problem?

All is good now? if not, or of the issue comes back, id appreciate if you could send us the project (as is, via private mail) so we can have a look.

thanx!
marc

Ah, maybe the .tt-generated files and the .pas files both had th attribute, and that was the problem?

Precisely that!

All good now on this point, although I’ve since hit a run-time issue which is even more concerning!

I’ll raise another query shortly with a working example but, sadly, I now have to revert to v9 to continue the day job.