vb.net bug with VS2003

G

Guest

We discovered that when you declare a function and variable with the same
name adding New key word to the variable, vb.net hangs when you try to build
the project :

imports System.Data
imports System.Data.SqlClient

Public Class TestBug

Public Function DoSomething(ByVal dummy As Integer) As IDataAdapter

Dim DoSomething As New SqlDataAdapter


End Function

End Class

You will need to restart VS in order to recover, but VS will not identify
the cause of this error.
 
C

Cor Ligthert

Mirza,

This one is real weird with this code the IDE becomes completly
unpredictable.

Cor
 
K

kevin

Interesting, I just tried the same thing - and noticed the same
behavior - although It only occured when I declared the objects of the
same type. I did not attempt to Build the offending project, but my
intellisence and some other aspects of the Devenv stopped functioning.

It is understandable that you cannot attempt to do what the attempt is
stating, because DoSomething is already a local variable to the
function - and doesnt make programmatic sense to declare a new object
of that type. You would instead say DoSomething = new SqlDataAdapter.
It is a bit disconcerting, however, that Microsoft overlooked this
error during there testing cycles.

Oh wait - aren't we their testing cycle?

Kevin M. Schreiner
VP Software Architecture
Business Intelligence Force, Inc.
 
H

Herfried K. Wagner [MVP]

Mirza said:
We discovered that when you declare a function and variable with the same
name adding New key word to the variable, vb.net hangs when you try to
build
the project :

imports System.Data
imports System.Data.SqlClient

Public Class TestBug

Public Function DoSomething(ByVal dummy As Integer) As IDataAdapter

Dim DoSomething As New SqlDataAdapter


End Function

End Class

VS.NET 2002:

"
 
C

Cor Ligthert

Herfried,

Do you believe a lot of visitors in this newsgroup understand what you mean.

:)

Cor
 
H

Herfried K. Wagner [MVP]

Cor,

Cor Ligthert said:
Do you believe a lot of visitors in this newsgroup understand what you
mean.

I currently don't have VS 2003 at hand, but does it show a similar error
message?
 
C

Cor Ligthert

Herfried,

I did not try it that far, the IDE became completly weird.

Do you want me to do that, you know it is friday, and you do not believe it,
tonight I have drunk cheap Austrian wine (Veltiner), however I found it very
good.

When you want me to try it, I do it tomorrow.

Cor
 
H

Herfried K. Wagner [MVP]

Cor,

Cor Ligthert said:
I did not try it that far, the IDE became completly weird.

;-)

I currently only have access to VS 2002. In this version the text I posted
previously is shown in a messagebox and then the IDE behaves weird.
Do you want me to do that, you know it is friday, and you do not believe
it, tonight I have drunk cheap Austrian wine (Veltiner), however I found
it very good.
:)

When you want me to try it, I do it tomorrow.

It's not so important, but I am curious about the reaction of VS 2003.

"Don't drink and code!"
 
H

Herfried K. Wagner [MVP]

kevin said:
VS 2003 has the exact same issue, that was the version I tested
(previous post)

I currently don't have the current version of VS 2005 at hand. I'll check
if the problem still exists there in a few days.
 

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