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

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?

rangers99Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Regards!
B..M
mmarinov
0
rangers99Author Commented:
Hi
Yes I have all the dll's and 'code behinds' in the correct directory.
0
mmarinovCommented:
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

rangers99Author Commented:
Thanks but Ive definetly built the application before copying the files. Also its not a directory problem
0
mmarinovCommented:
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
rangers99Author Commented:
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
mmarinovCommented:
rangers99,

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

Regards!
B..M
mmarinov
0
rangers99Author Commented:
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
mmarinovCommented:
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
rangers99Author Commented:
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
mmarinovCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rangers99Author Commented:
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
mmarinovCommented:
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
rangers99Author Commented:
Hi BM

You were correct all along

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

does the trick

thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.