I've written a DLL that contains a bunch of classes. One of my methods validates the contents of a file and throws any necessary exceptions based on invalid content - I'm using a standard "throw new exception..." call ...the thing is, when my code reaches the line where the exception is thrown, my Visual Studio IDE hangs up on that line instead of the external call to my validate method.
A short conceptual example to demonstrate:
MyDLL content:
Expand|Select|Wrap|Line Numbers
- Public Class FileContent
- Public Function ValidateFile(ByVal FileName As String) As Boolean
- If Not System.IO.File.Exists(FileName) Then
- Throw New IOException("File "& FileName & " doesn't exist.")
- End If
- End Function
- End Class
Expand|Select|Wrap|Line Numbers
- Imports MyDLL
- Public Module Module1
- Sub Main()
- Dim oFC As New FileContent
- oFC.ValidateFile("C:\FileThatDoesntExist.txt")
- End Sub
- End Module
If someone is using my DLL, I don't want them to have access to my code if their file doesn't validate, I just want them to have access to the any exceptions that are raised...am I expecting too much of VS 2005 or is this possible?