473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sub Main Not Found

Okay...this is my last post for the week!! I've been follwoing the examples
in BOL/MSDN and yet I'm encountering issues constantly. This one is actually
occuring when I'm in VS and trying to create the actuall script. Here are the
steps I'm taking:

1. Create a new empty VB project called Project3
2. Add a web reference to the Reporting Services web service. This succeeds.
The reference appears in my solution explorer.
3. I ADD a new item - a VB codefile.
4. I add the following code to the code file:

Imports Project3.RSWebReference

Public Shared Sub Main()
Dim rs As New ReportingService2005()
Dim items() As CatalogItem
items = rs.ListChildren("/", True)

Dim item As CatalogItem
For Each item In items
Console.WriteLine(item.Name)
Next item

End Sub

5. Intellisense picks everything up. However, when I try to debug this code,
I get the following:

'Sub Main' was not found in 'Project3'

As you can see, Sub Main IS in the project. I have also verified that Sub
Main is chosen as the Start Up Object in Project Properties.

I seriously don't get it...what am I missing??
Mar 13 '07 #1
2 7635
Hi,

Not sure what you meant by a "code file". Is this is a class or a a module
file ? In both cases the sub should be inside a module or a class statement.

Does the reference to RS matter or do you have the same result with no
reference and an empty Main subroutine ?
"A. Robinson" <AR*******@discussions.microsoft.coma écrit dans le message
de news: 07**********************************@microsoft.com...
Okay...this is my last post for the week!! I've been follwoing the
examples
in BOL/MSDN and yet I'm encountering issues constantly. This one is
actually
occuring when I'm in VS and trying to create the actuall script. Here are
the
steps I'm taking:

1. Create a new empty VB project called Project3
2. Add a web reference to the Reporting Services web service. This
succeeds.
The reference appears in my solution explorer.
3. I ADD a new item - a VB codefile.
4. I add the following code to the code file:

Imports Project3.RSWebReference

Public Shared Sub Main()
Dim rs As New ReportingService2005()
Dim items() As CatalogItem
items = rs.ListChildren("/", True)

Dim item As CatalogItem
For Each item In items
Console.WriteLine(item.Name)
Next item

End Sub

5. Intellisense picks everything up. However, when I try to debug this
code,
I get the following:

'Sub Main' was not found in 'Project3'

As you can see, Sub Main IS in the project. I have also verified that Sub
Main is chosen as the Start Up Object in Project Properties.

I seriously don't get it...what am I missing??

Mar 13 '07 #2
Hi,

Is your shared sub Main inside a Class?

Cor

"A. Robinson" <AR*******@discussions.microsoft.comschreef in bericht
news:07**********************************@microsof t.com...
Okay...this is my last post for the week!! I've been follwoing the
examples
in BOL/MSDN and yet I'm encountering issues constantly. This one is
actually
occuring when I'm in VS and trying to create the actuall script. Here are
the
steps I'm taking:

1. Create a new empty VB project called Project3
2. Add a web reference to the Reporting Services web service. This
succeeds.
The reference appears in my solution explorer.
3. I ADD a new item - a VB codefile.
4. I add the following code to the code file:

Imports Project3.RSWebReference

Public Shared Sub Main()
Dim rs As New ReportingService2005()
Dim items() As CatalogItem
items = rs.ListChildren("/", True)

Dim item As CatalogItem
For Each item In items
Console.WriteLine(item.Name)
Next item

End Sub

5. Intellisense picks everything up. However, when I try to debug this
code,
I get the following:

'Sub Main' was not found in 'Project3'

As you can see, Sub Main IS in the project. I have also verified that Sub
Main is chosen as the Start Up Object in Project Properties.

I seriously don't get it...what am I missing??

Mar 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Bruneau | last post by:
Hi Folks, I wonder what I need to do. I make a REAL simple design, One losuy form that has an allocated 'Name' property - Form1 I build solution without an issue.
4
by: Jacek Dziedzic | last post by:
Hi! First of all, I hope my problem is not too loosely tied to the "standard C++" that is the topic of this group. I have some code that exhibits a strange behaviour: on one computer, where I...
19
by: Steven T. Hatton | last post by:
The short sample program listed below has some features that I find to be bad style. In particular, they fail to communicate the connection between names used in this program and the location in...
16
by: Geoff Jones | last post by:
Hi What is the closest equivalent to Main in a VB.Net form? Geoff
9
by: Paulers | last post by:
Hello vb.net experts :) I am trying to program an app that resides in the system tray and I am trying to put all my main code in sub Main(). I am getting this errormessage at compile: ...
12
by: Brian Shafer | last post by:
Hi, In VB Classic I used a sub main() in all my programs. How do I do that in VB.net without setting the application type to Console application? Looks like when I set it to console it disable...
6
by: flash | last post by:
write a program that manipulates arrays of integers. The main program should call three functions: Insert, Delete, and Search. The Insert function should call a function Sort that sorts the array. ...
1
by: kumarangopi | last post by:
Iam working with graphics.I wrote a pgogram in turbo c for graphics.I need to run on Freebsd system, so installed SDL and trying.when i give make in sdl_image folder /usr/lib/crt1.o undefined...
80
by: Ioannis Vranos | last post by:
Hi, in C90 is "int main()" valid, the same as "int main(void)" and "int main(int argc, char *argv)"? AFAIK in C99 only "int main(void)" and "int main(int argc, char *argv) - and the **argv...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.