[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Why doesn't my ASP.NET Application Work Online?

Posted on 2004-11-07
14
Medium Priority
?
245 Views
Last Modified: 2008-03-17
Hi

 I have developed an ASP.NET based wesbite using VisualBasic.NET. I installed IIS on my standalone PC so I could test my site as though I was online. It worked fine

Ive now FTPed the site to a server so that it is now on the Internet. However the code throws exceptions.

eg. A field in a class Ive defined in a separate module cant be found. Ive FTPed all the code so why cant it find this?

As I say it works fine on my standalone PC using IIS.

Any pointers?

0
Comment
Question by:rangers99
  • 7
  • 7
14 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 12521286
Hi rangers99,
do you have a copy of these dll ( of the separate module ) in your /bin directory ?

Regards!
B..M
mmarinov
0
 

Author Comment

by:rangers99
ID: 12522239
Hi
Yes I have all the dll's and 'code behinds' in the correct directory.
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12522278
if just a field in a class is not defined - the reason is that you have copied to the server the files before build
if a class is not found - check if your directory is a virtual directory with created application ( in the IIS console )

B..M
mmarinov
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rangers99
ID: 12541062
Thanks but Ive definetly built the application before copying the files. Also its not a directory problem
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12541654
can you post the exact error message and also the place where the exception was thrown ?
the problem of not finding a class in a module can be cause either because the dll file has not been copied, or there is an eralier version or a dll should stand in Global Asembly Cache but it is not there

B..M
mmarinov
0
 

Author Comment

by:rangers99
ID: 12541901
Hi BM, This is the error I get. It gets thrown when I do

if TradeX.Buy = "B" then..................

TradeX is a an object of type Trade.



==================================================


Server Error in '/' Application.
--------------------------------------------------------------------------------

Public member 'Buy' on type 'Trade' not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMemberException: Public member 'Buy' on type 'Trade' not found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[MissingMemberException: Public member 'Buy' on type 'Trade' not found.]
   Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +879
   cgtcalc1.WebForm1.CalcButton_Click(Object sender, EventArgs e) +4593
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277

0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12541909
rangers99,

can you post the class TradeX with Buy definition in it too ?

Regards!
B..M
mmarinov
0
 

Author Comment

by:rangers99
ID: 12542163
Yep here it is (PS. Im in Singapore just now so amy have difficulty responding quickly)

Public Class Trade
        Private _Date As Date
        Private _Epic As String
        Private _Buy As Boolean
        Private _Shares As Decimal
        Private _Price As Decimal
        Private _Tax As Decimal
        Private _Charges As Decimal
        Private _Total As Decimal
        Private _SharesNotMatched As Decimal

        Public Property Date1() As Date
            Get
                Return _Date
            End Get
            Set(ByVal Value As Date)
                _Date = Value
            End Set
        End Property


        Public Property Epic() As String
            Get
                Return _Epic
            End Get
            Set(ByVal Value As String)
                _Epic = Value
            End Set
        End Property

        Public Property Buy() As Boolean
            Get
                Return _Buy
            End Get
            Set(ByVal Value As Boolean)
                _Buy = Value
            End Set
        End Property

        Public Property Shares() As Decimal
            Get
                Return _Shares
            End Get
            Set(ByVal Value As Decimal)
                _Shares = Value
            End Set
        End Property

        Public Property Price() As Decimal
            Get
                Return _Price
            End Get
            Set(ByVal Value As Decimal)
                _Price = Value
            End Set
        End Property



        Public Property Tax() As Decimal
            Get
                Return _Tax
            End Get
            Set(ByVal Value As Decimal)
                _Tax = Value
            End Set
        End Property



        Public Property Charges() As Decimal
            Get
                Return _Charges
            End Get
            Set(ByVal Value As Decimal)
                _Charges = Value
            End Set
        End Property

        Public Property Total() As Decimal
            Get
                Return _Total
            End Get
            Set(ByVal Value As Decimal)
                _Total = Value
            End Set
        End Property

        Public Property SharesNotMatched() As Decimal
            Get
                Return _SharesNotMatched
            End Get
            Set(ByVal Value As Decimal)
                _SharesNotMatched = Value
            End Set
        End Property
    End Class
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12542236
it is not a problem for the response
as i see from your code, i'm convinced of that the code is not build correct and the property Buy is not included in your dll
try to build it again, check that everything is building correct ( all projects that are included in your solution must be build without errors ) and update the dll to your server

B..M
mmarinov
0
 

Author Comment

by:rangers99
ID: 12563332
Ok heres an update. I now know which line is throwing the excpetion. Its  a hellish job trying to pin this down because Ive got to download code for every change I make.

code snippet.................

        pos = 0
         While pos < Trades.Count And Not SellFound
                 If Trades(pos).Buy = True Then
                    pos = pos + 1


The exception is being thrown when 'Trades(pos).Buy' is executed

'Trades' is an arraylist
And Ive added several objects of type 'Trade' to this arraylist. Ive checked and  Trades.Count = 8

So Ive created several Trade objects and set all the fields and then done Trades.Add(TradeX)

The problem appears to be the arraylist. Ive tried pos at 0 and at 1 so its not an index error.


 
0
 
LVL 28

Accepted Solution

by:
mmarinov earned 2000 total points
ID: 12563409
so the problem is that Trades(pos) return object type not Trade type
so you have touse

If CType(Trades(pos), Trade).Buy = True Then

B..M
mmarinov
0
 

Author Comment

by:rangers99
ID: 12563464
Sorry for not being clear. The Arraylist 'Trades' contains objects of type 'Trade'.

It all works perfectly until I transfer it on to the Internet. And its not the dlls.
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12563480
have you tried to restart the IIS, because it has sometimes problems to cached dlls and if you upload before this dll without Buy property it may be use it instead of ne version

B..M
mmarinov
0
 

Author Comment

by:rangers99
ID: 12572362
Hi BM

You were correct all along

"If CType(Trades(pos), Trade).Buy = True Then"

does the trick

thanks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question