Tuesday, March 13, 2012

troubleshooting conflicting DLL references.

Here's the scenario:

We've purchased DTSearch search engine.

It ships with a .net api dll that we can add to our project.

Adding this DLL as a new reference, however, kills my project and spits out
a seemingly irrelevant error:
-----------------
C:\Inetpub\wwwroot\userControls\cioPostingDisplay. ascx.vb(58) : error
BC30392: 'Catch' cannot catch type 'exception' because it is not
'System.Exception' or a class that inherits from 'System.Exception'.
C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(106) : error
BC30392: 'Catch' cannot catch type 'exception' because it is not
'System.Exception' or a class that inherits from 'System.Exception'.
C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(108) : error
BC30456: 'Message' is not a member of 'exception'.
C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(108) : error
BC30456: 'Source' is not a member of 'exception'.
-----------------

What are things that could possibly cause this? The vendor (rightfully so)
finds this behavior odd...as do I.

-DarrelIt looks pretty clear to me:
error BC30392: 'Catch' cannot catch type 'exception' because it is not
'System.Exception' or a class that inherits from 'System.Exception'.

Your catch needs to be:
Try
' ... code
Catch(exception As System.Exception)
' ... code
Finally
' ... code
EndCatch

The remaining errors are because you're attempting to access member
properties and methods of System.Exception from a class that isn't derived
from System.Exception. Once you fix your catch statement, the rest ought to
work.

"darrel" wrote:

> Here's the scenario:
> We've purchased DTSearch search engine.
> It ships with a .net api dll that we can add to our project.
> Adding this DLL as a new reference, however, kills my project and spits out
> a seemingly irrelevant error:
> -----------------
> C:\Inetpub\wwwroot\userControls\cioPostingDisplay. ascx.vb(58) : error
> BC30392: 'Catch' cannot catch type 'exception' because it is not
> 'System.Exception' or a class that inherits from 'System.Exception'.
> C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(106) : error
> BC30392: 'Catch' cannot catch type 'exception' because it is not
> 'System.Exception' or a class that inherits from 'System.Exception'.
> C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(108) : error
> BC30456: 'Message' is not a member of 'exception'.
> C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(108) : error
> BC30456: 'Source' is not a member of 'exception'.
> -----------------
> What are things that could possibly cause this? The vendor (rightfully so)
> finds this behavior odd...as do I.
> -Darrel
>

> Here's the scenario:
> > We've purchased DTSearch search engine.
> > It ships with a .net api dll that we can add to our project.
> > Adding this DLL as a new reference, however, kills my project and spits out
> a seemingly irrelevant error:
> -----------------
> C:\Inetpub\wwwroot\userControls\cioPostingDisplay. ascx.vb(58) : error
> BC30392: 'Catch' cannot catch type 'exception' because it is not
> 'System.Exception' or a class that inherits from 'System.Exception'.
> C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(106) : error
> BC30392: 'Catch' cannot catch type 'exception' because it is not
> 'System.Exception' or a class that inherits from 'System.Exception'.
> C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(108) : error
> BC30456: 'Message' is not a member of 'exception'.
> C:\Inetpub\wwwroot\userControls\staticContentDispl ay.ascx.vb(108) : error
> BC30456: 'Source' is not a member of 'exception'.
> -----------------
> > What are things that could possibly cause this? The vendor (rightfully so)
> finds this behavior odd...as do I.
> > -Darrel

bit late, but first use system.exception instead of plain exception.

if u use Crystal Reports btw, there is your possible problem.
it uses also Exception, dunno why, but they do it

User submitted from AEWNET (http://www.aewnet.com/)

0 comments:

Post a Comment