Prilikom pokretanja programa u "Debug" konfiguraciji dobijam grešku {System.InvalidCastException}. Možda to i ne zvuči toliko čudno, ali ako konfiguraciju promenim u "Release" sve radi kako treba. Još jedna čudna stvar je ta da je pre mesec dana isti kod radio u obe konfiguracije.
Probao sam da uradim Clean Solution, brisao ceo folder gde se nalazi debug konfiguracija, gasio VS i ostao bez ideje kako (i u čemu) je problem
Problematični kod je
Da li neko ima rešenje?
Probao sam da uradim Clean Solution, brisao ceo folder gde se nalazi debug konfiguracija, gasio VS i ostao bez ideje kako (i u čemu) je problem
Problematični kod je
Code:
For Each File As IO.FileInfo In New IO.DirectoryInfo(sFolder).GetFiles("*.dll", IO.SearchOption.AllDirectories)
Dim Asm As Reflection.Assembly
Dim cParser As IParser
Try
Asm = Reflection.Assembly.LoadFrom(File.FullName)
For Each t As Type In Asm.GetTypes
If Not t.GetInterface("IParser") Is Nothing Then
cParser = DirectCast(Asm.CreateInstance(t.Namespace & "." & t.Name), IParser) ' <---- greška je naravno ovde
...
...
...
End If
Next
Catch ex As Exception
debug.print ex.message
End Try
Next
For Each File As IO.FileInfo In New IO.DirectoryInfo(sFolder).GetFiles("*.dll", IO.SearchOption.AllDirectories)
Dim Asm As Reflection.Assembly
Dim cParser As IParser
Try
Asm = Reflection.Assembly.LoadFrom(File.FullName)
For Each t As Type In Asm.GetTypes
If Not t.GetInterface("IParser") Is Nothing Then
cParser = DirectCast(Asm.CreateInstance(t.Namespace & "." & t.Name), IParser) ' <---- greška je naravno ovde
...
...
...
End If
Next
Catch ex As Exception
debug.print ex.message
End Try
Next
Da li neko ima rešenje?
Potpis
Naučio sam...
Da je važnije biti ljubazan nego biti u pravu
Da je važnije biti ljubazan nego biti u pravu