Help needed with syntax errors in vb.net app

A 3rd party wrote a small sample project for us, and it has no syntax errors when I deploy it in visual studio 2008.

But when I bring her references, web references, and .vb items over to MY project, there is one .vb item that gives me syntax errors--and I can't figure out why.  I have attached a screen shot showing the four errors, and the error descriptions at the bottom.  I cannot see any difference in her code and my code, and I don't understand the errors.  If needed, I (think I) can attach her sample project.  Any ideas what is causing these errors?  TIA
SS101.jpg
LVL 3
sasllcAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Éric MoreauSenior .Net ConsultantCommented:
add this at the top of your class:
Imports System.Collections.Generic

Open in new window

0
Maheshwar RSoftware DeveloperCommented:
I think your missing a reference on your project, ass the reference in your code file . Check the reference in her code file and then check that you have imported the same references or not.
0
sasllcAuthor Commented:
Adding the "Imports System.Collections.Generic" fixed those four syntax errors, thank you.  Why she didn't need it in her code is a mystery to me.

So now that just leaves me with two other syntax errors.  The 1st  attachment shows the errors.  The line that has the "JsonConvert" underlined says "Name 'JsonConvert' is not declared" in the error description at the bottom.  If I go back to her code (that has no errors) and point to "JsonConvert", it says "Class JsonConvert", and if I right click and "Go to Definition", it shows all the parameters for Newtonsoft.Json as can be seen in the 2nd attachment.

Then back to my code...if I go to View > Object Browser, I see the exact same information about NewtonsoftJson > JsonConvert...or at least it looks identical to me.  I'm assuming all this comes from the Newtonsoft.Json.Compact.dll shown in the Solution Explorer in her code in my 3rd attachment.  Note that in MY code, Newtonsoft.Json.Compact.dll IS in the list of references (like is in hers), but in my code Newtonsoft.Json.Compact.dll does not show at the bottom of the Solution Explorer like it does in hers.  And, in my code, Newtonsoft.Json.Compact.xml does not appear anywhere, but someone told me that this .xml file is optional and has no bearing on things working right.

Might these differences be causing the problem, or is there something special here that I need to do to "declare" it?

And then in regard to the "latebinding" errors,  might they be resolved once the "Name 'JsonConvert' is not declared" error is fixed?
SS102.jpg
SS103.jpg
SS098.jpg
0
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Éric MoreauSenior .Net ConsultantCommented:
>>Adding the "Imports System.Collections.Generic" fixed those four syntax errors, thank you.  Why she didn't need it in her code is a mystery to me.

It is propably in the Properties of the project.

For json, you are also probably missing the import clause. if you click the red underline under the "t", you should see a popup offering you to solve the issue.
0
sasllcAuthor Commented:
OK, I took one of the choices by adding "Imports Newtonsoft.Json", and that resolved the error about not being declared.

But unfortunately all those "latebinding" errors are still there, as shown in my first attachment.  Of course, they don't appear in her code.  Any idea what could be causing these, and how to fix them?
0
Éric MoreauSenior .Net ConsultantCommented:
Are you targeting the Compact framework in your new project (while the original project is targeting the full Framework)? The message is very clear if this is your case that late-binding is not supported on that platform.
0
sasllcAuthor Commented:
I was wondering if that has something to do with it...but I don't know how this could be, since her project was supposed to be for compact framework, and her project DOES run on my handheld device like it is supposed to.  All of my projects start as being for a "Smart Device", because they are always for handheld scanners running Windows CE.  I did notice in my project that I could to go to Project at the top, and near the bottom it said I could Upgrade (or something like that), and when I chose that option it said it would upgrade the project to .net 3.5...which I don't understand at all, because I thought this project was at 3.5 all along, long since upgraded from 2.0.

But even after I did that, the latebinding errors remain.  When it says "targeted version", is that the same as going to Project > Change Target Platform?  If I go there, in her project and in mine, they both show the current platform as Windows CE, just as I would have expected.

Is there somewhere else I should go in Visual Studio 2008 to see the "targeted version" that both projects are on?
0
Éric MoreauSenior .Net ConsultantCommented:
so if you are both targeting the same version of the .Net Framework (as shown in the Project properties), there is surely something else.

Are you both referencing exactly the same JSon library (same version? You can find that in the Properties of your project under the References tab.

In her project, does she cast (using CType or DirectCast or ...) the result of myShippingOrder?
0
sasllcAuthor Commented:
Also, in looking around on the internet about this error, I see where some people are saying that this problem may be caused by not defining the variable type.  In my line of code that says "Dim myShippingOrder = JsonConvert.DeserializeObject(Of JSONParser.JSON_result)(JsonData)", the variable "myShippingOrder" has a green line under it, and if I point to it, it says "Variable declaration without an 'as' clause; type of Object is assumed".

So I wonder if it would help to define it with an "As" clause, and if so, what would be the type of Object in this case?
0
Éric MoreauSenior .Net ConsultantCommented:
oh, I missed that (to used to more recent version of .Net).

You are missing the As clause. What does the other code shows for the type?

Dim MyShippingOrder AS ... = JsonConvert

Open in new window

0
Éric MoreauSenior .Net ConsultantCommented:
what is the name of the class defining WhOrderNum and Marks and Bales and ... ? This name is your datatype that goes in the As clause.
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
sasllcAuthor Commented:
She did not have an "As" in her code--which is why I didn't have one either--but once you told me how to find that datatype and use that as my "As", that cleared up the syntax errors.  Thank you!
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
Visual Basic.NET

From novice to tech pro — start learning today.