Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > ASP.NET > ASP.NET General Discussion

ASP.NET General Discussion General discussion on ASP.NET development with VB.NET

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-14-2009, 10:36 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jan 2009
Posts: 2
Reputation: 0
Morcyk is on a distinguished programming path ahead
Default Odd build error

This issue may straddle more than just ASP .NET, but since it's an ASP .NET web site I'm having an issue with, here it is.

The environment: VB .NET, Framework 3.5, VS 2008, ASP .NET web site

The issue:
1. Building (Rebuilding too) the site results in the following error, but only in the output window (error list shows 0 errors, 0 warnings):
C:\Web\Default.aspx.vb(85,0): error BC30456: 'Drive' is not a member of 'Car'.
Validation Complete
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

2. The problem is, 'Drive' IS a member of 'Car'. Not only that, but if I hover over the 'Drive' method call on my instance in the IDE, it shows it as being a member of 'Car'. The 'Drive' method shows up in intellisense. I can even right click this "unknown" item and go to definition and it takes me to the spot that 'Drive' is defined. I've already tried restarting IIS and the computer with no luck. I'm at a loss on this one.

Here's the affected code.:

web (default.aspx):
<asp:Content ID="Content2" ContentPlaceHolderID="cphSiteData" Runat="Server">
<div class="cssDivCenter">
<asp:TextBox ID="txtMake" runat="server"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_OnClick" />
</div>
</asp:Content>

click event (default.aspx.vb excerpt):
Public Sub btnSubmit_OnClick(ByVal sender As Object, ByVal e As EventArgs)
Dim myCar As New Car()

'THIS IS THE LINE THE ERROR IS THROWN ON
If Not myCar.Drive() Then
'Do Something
End If
End Sub

class & interface data:
Public Interface IVehicle
Function Drive() As Boolean
End Interface

Public MustInherit Class Vehicle
Implements IVehicle

Public MustOverride Function Drive() As Boolean Implements IVehicle.Drive
End Class

Public Class Car
Inherits Vehicle

Public Overrides Function Drive() As Boolean
Dim retVal As Boolean = True

Try
'Do something
Catch ex As Exception
'exception
End Try
Return retVal
End Function
End Class
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-14-2009, 11:20 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jan 2009
Posts: 2
Reputation: 0
Morcyk is on a distinguished programming path ahead
Default

I found the issue, so here's what was happening:

I had another class of the same name in the project that was causing a conflict. The odd part is that IDE specific items (intellisense, go to definition, etc.) were using the instance I was expecting, which is why it looked okay to me, but the build was using this other class. Fully qualifying the name fixed it.

Hope this helps someone else.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 6:33 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.