XML Warings from generated code

Posts   
 
    
Stoop
User
Posts: 66
Joined: 28-Feb-2004
# Posted on: 08-Feb-2006 10:40:50   

Hello

We are now using VS 2005. When I generate code (VB.NET) from LLGen and then open up corresponding project to complile I get a TON of XML warnings. I have a rather large project (30 tables) so the sum of the warnings really chews up a lot of resources and also takes forever to complile. Below is an example of one of the warnings which is repeated in all entity classes:

    ''' <summary>Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, False otherwise.
    ''' Should Not be used For testing If the current value Is NULL, use <see cref="TestCurrentFieldValueForNull"> For that.</summary>
    ''' <param name="fieldIndex">Index of the field to test if that field was NULL in the persistent storage</param>
    ''' <returns>true if the field with the passed in index was NULL in the persistent storage, False otherwise</returns>

Public Function TestOriginalFieldValueForNull(fieldIndex As AdditionalPriceTypeFieldIndex) As Boolean Return MyBase.Fields(CInt(fieldIndex)).IsNull End Function

Apparently the problem is the "<see cref.." part as it doesn't like the "<"

I manually changed one and this is fine:

''' <summary>Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, False otherwise. ''' Should Not be used For testing If the current value Is NULL, use (see cref="TestCurrentFieldValueForNull") For that. ''' </summary> ''' <param name="fieldIndex">Index of the field to test if that field was NULL in the persistent storage</param> ''' <returns>true if the field with the passed in index was NULL in the persistent storage, False otherwise</returns> Public Function TestOriginalFieldValueForNull(fieldIndex As AdditionalPriceTypeFieldIndex) As Boolean Return MyBase.Fields(CInt(fieldIndex)).IsNull End Function

Can you point me to the template file where I can manually fix this? Thanks Stoop

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Feb-2006 11:40:33   

It's a thing they introduced in VS.NET 2005, to avoid ambiguity between XML comments, but it turned out to be a true nightmare. If you change the <> into (), you won't get a reference link to the field in the generated documentation, so that's not a proper option I think. So <see cref="TestCurrentFieldValueForNull"> should become TestCurrentFieldValueForNull

to avoid warnings of a given number, you can order the vbc compiler to ignore warnings with a given number: vbc /nowarn:42024 will ignore warning number 42024.

To surpress the useless warnings in C# they added a #pragma precompiler directive directly to the language, though I couldn't find an alternative for VB.NET... I also am not sure how to set the nowarn option in the VS.NET IDE...

If you're using adapter, this is in the template: SharedTemplates\VB.NET\entityAdapter.template if you're using selfservicing it's in SharedTemplates\VB.NET\entityInclude.template

Frans Bouma | Lead developer LLBLGen Pro
Stoop
User
Posts: 66
Joined: 28-Feb-2004
# Posted on: 09-Feb-2006 17:35:59   

Thanks for the reply!

2 things:

1) I made a mistake in my original post. What works is [see cref="TestCurrentFieldValueForNull"] , not (see cref="TestCurrentFieldValueForNull") . sorry..

2) I will just edit the template so that it outputs above..

Yeah - I agree with you. This XML thing they introduced is a nightmare. Especially in projects converted from VB 2003 to 2005. There is a way to set errors and warnings in VB IDE, but it doesn't include turning off (IMHP this useless) XML warnings at least as far as I know.. sigh...

thanks again Stoop

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Feb-2006 18:21:50   

Ghostdoc introduces a T: in front of the type, which solves the warnings in C#. Could you try that instead of replacing <> with [], so I can make the general change to the vb.net templates for the next build?

(so it will become: <see cref="T:TestCurrentFieldValueForNull"> )

Frans Bouma | Lead developer LLBLGen Pro