Use NDoc with SQLCe reference

F

franky

Most of my project have a lot of SQLCe SQLClient reference.... How can I
use the NDoc Tool?

with small exemple please... :*)

thanks!
 
P

Peter Foot [MVP]

The only way currently is to hide any .NETCF specific code from NDoc. This
is usually done by setting up a separate configuration in your solution -
e.g. Debug, Release, NDoc. Within the NDoc configuration you can add a
compilation constant e.g. NDOC - then in your code you can place conditional
compilation 'if' statements around your sqlce specific code.

#if !NDOC

//sqlce specific code

#endif

The result of this is either to exclude large sections of code, or to write
incredibly detailed workarounds for example by providing dummy methods in an
else block e.g.

#if !NDOC

//sqlce code
#else
//dummy headers
#endif


Peter
 
F

franky

I read the article more than one time.
I add this kind of thing in my code:
_______________
#if !NDOC
using System.Data.SqlServerCe;
#endif
...
#if !NDOC
public static void ShowSqlErrors(SqlCeException e)
{...}
#endif
___________________

but I still have a error?!
Exception: System.IO.FileLoadException
at System.Reflection.RuntimeMethodInfo.InternalGetParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at NDoc.Core.BaseDocumenter.GetMemberName(MethodBase method)
at NDoc.Core.BaseDocumenter.WriteMethod(XmlWriter writer, MethodInfo
method, Boolean inherited, Int32 overload, Boolean hiding)
at NDoc.Core.BaseDocumenter.WriteMethods(XmlWriter writer, Type type)
at NDoc.Core.BaseDocumenter.WriteClass(XmlWriter writer, Type type, Boolean hiding)
at NDoc.Core.BaseDocumenter.WriteClasses(XmlWriter writer, Type[] types, String namespaceName)
at NDoc.Core.BaseDocumenter.WriteNamespaces(XmlWriter writer, Module module)
at NDoc.Core.BaseDocumenter.WriteModule(XmlWriter writer, Module module)
at NDoc.Core.BaseDocumenter.WriteAssembly(XmlWriter writer)
at NDoc.Core.BaseDocumenter.MakeXml(Project project)

Do I need to remove the reference?
 
P

Peter Foot [MVP]

The problem with NDoc is that it doesn't tell you the exact point at which
loading failed - it can therefore be very difficult to determine which piece
of code it is not comfortable with.

The recently posted NDoc 1.3 Beta has better error support as it indicates
what reference could not be resolved. Do you have any code which is not
conditioned out using this method which uses Microsoft.WindowsCE.Forms, or
System.Net.IrDA?

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

franky said:
I read the article more than one time.
I add this kind of thing in my code:
_______________
#if !NDOC
using System.Data.SqlServerCe;
#endif
...
#if !NDOC
public static void ShowSqlErrors(SqlCeException e)
{...}
#endif
___________________

but I still have a error?!
Exception: System.IO.FileLoadException
at System.Reflection.RuntimeMethodInfo.InternalGetParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at NDoc.Core.BaseDocumenter.GetMemberName(MethodBase method)
at NDoc.Core.BaseDocumenter.WriteMethod(XmlWriter writer, MethodInfo
method, Boolean inherited, Int32 overload, Boolean hiding)
at NDoc.Core.BaseDocumenter.WriteMethods(XmlWriter writer, Type type)
at NDoc.Core.BaseDocumenter.WriteClass(XmlWriter writer, Type type, Boolean hiding)
at NDoc.Core.BaseDocumenter.WriteClasses(XmlWriter writer, Type[]
types, String namespaceName)
at NDoc.Core.BaseDocumenter.WriteNamespaces(XmlWriter writer, Module module)
at NDoc.Core.BaseDocumenter.WriteModule(XmlWriter writer, Module
module)
at NDoc.Core.BaseDocumenter.WriteAssembly(XmlWriter writer)
at NDoc.Core.BaseDocumenter.MakeXml(Project project)

Do I need to remove the reference?
 
F

franky

Finally with a restart of the application it run fine....
:)

Can you suggest me a solution for the
public static void ShowSqlErrors(SqlCeException e)

A would like to see the overload in the doc?

__________________________
Franky
(e-mail address removed)
 
P

Peter Foot [MVP]

A half solution which would work is:-

#if !NDOC
public static void ShowSqlErrors(SqlCeException e)
{
}
#else
public static void ShowSqlErrors(Exception e)
{
}
#endif

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top