Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_web_matrix thread: compiling vb class


Message #1 by "Stan F. Vaninger" <sfvaninger@l...> on Fri, 12 Jul 2002 17:58:17
I am just getting started with ASP.NET WebMatrix. I have been reading the 
Inside ASP.NET Web Matrix book and am just getting started with the sample 
project. On about page 5 of part 2 of the book, a vb class is created and 
compiled into a dll using a one-line batch file: 

vbc /debug /nologo /t:library ... DataLayer.vb 

When I execute the batch file, I get the message: 

'vbc' is not recognized as an internal or external command, operable 
program or batch file. 

Any thoughts on what the problem is? Is it necessary to have some version 
of VisualBasic installed in order to use Web Matrix? (I do not). 

Thanks in advance.
Message #2 by philip.hatt@a... on Mon, 15 Jul 2002 11:51:43
Hello.

I think the problem is that you have not added the path to vbc.exe in your 
environment variable ( Control panel --> System --> Advanced --> 
Environment variables ). Add the path to vbc.exe, 
usually "C:\WINNT\Microsoft.NET\Framework\v1.0.3705", close your cmd and 
open it again. Try again.

Philip

> I am just getting started with ASP.NET WebMatrix. I have been reading 
the 
I> nside ASP.NET Web Matrix book and am just getting started with the 
sample 
p> roject. On about page 5 of part 2 of the book, a vb class is created 
and 
c> ompiled into a dll using a one-line batch file: 

> vbc /debug /nologo /t:library ... DataLayer.vb 

> When I execute the batch file, I get the message: 

> 'vbc' is not recognized as an internal or external command, operable 
p> rogram or batch file. 

> Any thoughts on what the problem is? Is it necessary to have some 
version 
o> f VisualBasic installed in order to use Web Matrix? (I do not). 

> Thanks in advance.
Message #3 by "Stan F. Vaninger" <sfvaninger@l...> on Mon, 15 Jul 2002 20:15:30
Philip,

Thanks very much for your reply which it appears was right on target. 
However, after adding the path and running the batch file again, I now get 
the error:

vbc : command line error BC2012 : can't open 'bin/DataLayer.dll' for 
writing

Here's the full text of my batch file that I am attempting to run:

vbc /debug /nologo /t:library /out:bin/DataLayer.dll /r:System.dll /r:Syste
m.Xml.dll /r:System.Web.dll /r:System.Data.dll DataLayer.vb

Any thoughts on what the issue is?

Stan


> Hello.

> I think the problem is that you have not added the path to vbc.exe in 
your 
e> nvironment variable ( Control panel --> System --> Advanced --> 
E> nvironment variables ). Add the path to vbc.exe, 
u> sually "C:\WINNT\Microsoft.NET\Framework\v1.0.3705", close your cmd and 
o> pen it again. Try again.

> Philip

Message #4 by philip.hatt@a... on Tue, 16 Jul 2002 08:12:37
Hello!

I really dont know what couuld cause this problem but it sounds like the 
dll file is write protected or it is in use by IIS. I know that IIS 
shouldn't lock any DLL files but I have noticed that so can happended in 
some cases.

Philip

> Philip,

> Thanks very much for your reply which it appears was right on target. 
H> owever, after adding the path and running the batch file again, I now 
get 
t> he error:

> vbc : command line error BC2012 : can't open 'bin/DataLayer.dll' for 
w> riting

> Here's the full text of my batch file that I am attempting to run:

> 
vbc /debug /nologo /t:library /out:bin/DataLayer.dll /r:System.dll /r:Syste
m> .Xml.dll /r:System.Web.dll /r:System.Data.dll DataLayer.vb

> Any thoughts on what the issue is?

> Stan

> 
>>  Hello.

> > I think the problem is that you have not added the path to vbc.exe in 
y> our 
e> > nvironment variable ( Control panel --> System --> Advanced --> 
E> > nvironment variables ). Add the path to vbc.exe, 
u> > sually "C:\WINNT\Microsoft.NET\Framework\v1.0.3705", close your cmd 
and 
o> > pen it again. Try again.

> > Philip

Message #5 by "Steve Wilkins" <steve.wilkins@c...> on Tue, 16 Jul 2002 15:26:36
You are compiling a dll inside your web application. Make sure you have 
the bin folder in the root of your web app.


Message #6 by "Stan F. Vaninger" <sfvaninger@l...> on Tue, 16 Jul 2002 15:31:31
Philip,

Thanks again for your response. I realized that the command in the batch 
file was expecting a bin sub-folder which I hadn't added yet. I have since 
done so and am now over that hump but am getting a long list of compile 
errors much like those reported by someone else a few days ago.

The first compile error is:

"error BC32017: Comma, ')', or a valid expression continuation expected"

on the 2nd line of code shown below

    Dim ds As New DataSet()
    ds.ReadXml(ctx.Server.MapPath(""pizzas.xml""))

Just curious. Have you gone through the Pretty Quick Pizza exercise in 
the "Inside ASP.NET Web Matrix" book or know of anyone who has?

Stan

> Hello!

> I really dont know what couuld cause this problem but it sounds like the 
d> ll file is write protected or it is in use by IIS. I know that IIS 
s> houldn't lock any DLL files but I have noticed that so can happended in 
s> ome cases.

> Philip

Message #7 by "Rick Nelson" <RickN@N...> on Tue, 16 Jul 2002 18:02:59
Haven't gone through PQP but I did finally realize that the Web Service 
template I was trying to use (see my earlier post) has a mixture of VB and 
C# code!  Doesn't compile, of course.  I don't know C# so it wasn't 
obvious to me at first.  Apparently template wasn't tested before 
releasing WM. Don't know if that's one of the problems you're running into 
but it may be a clue....

Rick N.

> Philip,

> Thanks again for your response. I realized that the command in the batch 
f> ile was expecting a bin sub-folder which I hadn't added yet. I have 
since 
d> one so and am now over that hump but am getting a long list of compile 
e> rrors much like those reported by someone else a few days ago.

> The first compile error is:

> "error BC32017: Comma, ')', or a valid expression continuation expected"

> on the 2nd line of code shown below

>     Dim ds As New DataSet()
 >    ds.ReadXml(ctx.Server.MapPath(""pizzas.xml""))

> Just curious. Have you gone through the Pretty Quick Pizza exercise in 
t> he "Inside ASP.NET Web Matrix" book or know of anyone who has?

> Stan

> > Hello!

> > I really dont know what couuld cause this problem but it sounds like 
the 
d> > ll file is write protected or it is in use by IIS. I know that IIS 
s> > houldn't lock any DLL files but I have noticed that so can happended 
in 
s> > ome cases.

> > Philip

Message #8 by "Stan F. Vaninger" <sfvaninger@l...> on Tue, 16 Jul 2002 22:38:26
I am happy to report that I finally got my DataLayer.vb class to compile 
into a dll with no errors. But I had to cheat to do it! I downloaded the 
sample files from http://www.AlAndDave.com/books/webmatrix/ and took a 
look at their DataLayer.vb file. It seems that there is some sort of mis-
print in the book: all of the places where there are 2 double-quote 
characters ("") should be just one double-quote ("). Having 2 double-
quotes together did look sort of weird to me. I went back to my own 
DataLayer.vb and changed all those "" to " and it compiled OK.

Stan
Message #9 by rod@s... on Wed, 17 Jul 2002 09:23:46 +0800
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22D30.991FBA8E
Content-Type: text/plain;
	charset="iso-8859-1"

Thanks for that, I was the one who had the compiling probs a few days back
and still hadn't found the error.

I also had to change the listing to use the cmd.Parameters.add when writing
the order row, Is this a typo in the book or have I missed something.



-----Original Message-----
From: Stan F. Vaninger [mailto:sfvaninger@l...]
Sent: Wednesday, 17 July 2002 6:38 AM
To: ASP.NET Web Matrix
Subject: [aspx_web_matrix] Re: compiling vb class


I am happy to report that I finally got my DataLayer.vb class to compile 
into a dll with no errors. But I had to cheat to do it! I downloaded the 
sample files from http://www.AlAndDave.com/books/webmatrix/ and took a 
look at their DataLayer.vb file. It seems that there is some sort of mis-
print in the book: all of the places where there are 2 double-quote 
characters ("") should be just one double-quote ("). Having 2 double-
quotes together did look sort of weird to me. I went back to my own 
DataLayer.vb and changed all those "" to " and it compiled OK.

Stan

Message #10 by "Stan F. Vaninger" <sfvaninger@l...> on Wed, 17 Jul 2002 14:30:55
Rod,

Did you have to make this change (from cmd.Parameters to 
cmd.Parameters.Add) to get the DataLayer.vb class to compile or to run 
correctly? I haven't gotten to the point where I can test the class yet, 
maybe today.

Stan

<<Thanks for that, I was the one who had the compiling probs a few days 
back
and still hadn't found the error.

I also had to change the listing to use the cmd.Parameters.add when writing
the order row, Is this a typo in the book or have I missed something.>>
Message #11 by rod@s... on Thu, 18 Jul 2002 08:55:36 +0800
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22DF5.D6768848
Content-Type: text/plain;
	charset="iso-8859-1"

Stan,
Just to compile, I haven't tested it either.
Let me know how you go.
Rod

-----Original Message-----
From: Stan F. Vaninger [mailto:sfvaninger@l...]
Sent: Wednesday, 17 July 2002 10:31 PM
To: ASP.NET Web Matrix
Subject: [aspx_web_matrix] Re: compiling vb class


Rod,

Did you have to make this change (from cmd.Parameters to 
cmd.Parameters.Add) to get the DataLayer.vb class to compile or to run 
correctly? I haven't gotten to the point where I can test the class yet, 
maybe today.

Stan

<<Thanks for that, I was the one who had the compiling probs a few days 
back
and still hadn't found the error.

I also had to change the listing to use the cmd.Parameters.add when writing
the order row, Is this a typo in the book or have I missed something.>>


  Return to Index