VB.Net compile proxy file errors

Hello experts,

I am trying to get to grips with using XML in VB.Net and have bought the Sams book "Microsoft.Net XML Web Services" to assist me in this purpose. I am currently working through the chapter "Consuming a Simple Web Service with .NET SDK".

I have successfully followed instructions up to creating a proxy file (pmcalc.vb) using the wsdl.exe utility, but I can't get the file to compile using the vbc.exe utility.

The command-line instruction given in the book is: vbc.exe /out:bin\pmcalc.dll /target:library /reference:system.xml.serialization.dll /reference:system.web.services.dll pmcalc.vb

Which returned this error:

vbc : Command line error BC2017 : could not find library 'system.xml.serialization.dll'
vbc : Fatal error BC2000 : compiler initialization failed unexpectedly: The system cannot find the file specified.

I read a suggestion (somewhere on the web, I forget where) that the ".serialization" part should now be omitted from the command, so I tried that and now I get the following list of errors:

C:\PMCalc_web\pmcalc.vb(27) : error BC30002: Type 'System.ComponentModel.DesignerCategoryAttribute' is not defined.

 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\PMCalc_web\pmcalc.vb(30) : error BC30007: Reference required to assembly 'Sys
tem' containing the base class 'System.ComponentModel.Component'. Add one to your project.

    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\PMCalc_web\pmcalc.vb(35) : error BC30456: 'Url' is not a member of 'pmcalc'.

        Me.Url = "http://localhost/pmcalc/pmcalc.asmx"
        ~~~~~~
C:\PMCalc_web\pmcalc.vb(41) : error BC30456: 'Invoke' is not a member of 'pmcalc'.

        Dim results() As Object = Me.Invoke("developerEstimate", New Object() {xintHours})
                                  ~~~~~~~~~

C:\PMCalc_web\pmcalc.vb(47) : error BC30456: 'BeginInvoke' is not a member of 'pmcalc'.

        Return Me.BeginInvoke("developerEstimate", New Object() {xintHours}, callback, asyncState)
               ~~~~~~~~~~~~~~

C:\PMCalc_web\pmcalc.vb(52) : error BC30456: 'EndInvoke' is not a member of 'pmcalc'.

        Dim results() As Object = Me.EndInvoke(asyncResult)
                                  ~~~~~~~~~~~~

I am wondering if the problems may be arising due to differences in the runtime versions of the .Net framework SDK.
The version refered to in the book is 1.0.2914 whereas the version on my (XP) system is 1.1.4322

The wsdl.exe tool also has different version numbers and creates a slightly different class code in the pmcalc.vb proxy file to that which is shown in the book.

Booking-iTAsked:
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.

Booking-iTAuthor Commented:
Should I have posted this elsewhere? vb.net perhaps? :o
shivam2kCommented:
it should be

vbc.exe /out:bin\pmcalc.dll /target:library /reference:system.xml.dll /reference:system.web.services.dll pmcalc.vb

system.xml.dll has system.xml.serialization namespace.
Booking-iTAuthor Commented:
If you read all of my first post you will see that I already tried that... it's what produced the long list of errors, beginning with:

       C:\PMCalc_web\pmcalc.vb(27) : error BC30002: Type 'System.ComponentModel.DesignerCategoryAttribute' is not defined.

Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

shivam2kCommented:
was my mistake,

check this out

vbc.exe /out:bin\pmcalc.dll /target:library /r:system.dll /r:system.xml.dll /r:system.web.services.dll pmcalc.vb

based on this error

error BC30007: Reference required to assembly 'Sys
tem' containing the base class 'System.ComponentModel.Component'

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
Booking-iTAuthor Commented:
Ha, I found an example at devCity.net which included the "/reference:system.dll" part, which worked. Came back to tell you that I had it working and found you'd already worked it out too.

Now I've found that the code - supplied by the book - in the default.aspx file contains a method which only existed in .Net pre-release. I think I'm about ready to dump this book :(

Can you tell me, how do I work out which references to include in the command line? I assume it has something to do with the "Imports" in the .vb file.

Thanks shivam2k
shivam2kCommented:
s, based on the imports you have to provide references

look for the .net assemblies that contains the namespaces.
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.